how to create BRF application via code

简介: 使用如下代码自动创建新的BRF application:

使用如下代码自动创建新的BRF application:


REPORT zceate_application.

DEFINE write_errors.

 IF &1 IS NOT INITIAL.

 LOOP AT &1 ASSIGNING .

 WRITE: -text.

 ENDLOOP.

 RETURN.

 ENDIF.

END-OF-DEFINITION.

START-OF-SELECTION.

 DATA: lo_factory     TYPE REF TO if_fdt_factory,

       lo_application TYPE REF TO if_fdt_application,

       lt_message     TYPE if_fdt_types=>t_message,

       lv_boolean     TYPE abap_bool.

 FIELD-SYMBOLS:  TYPE if_fdt_types=>s_message.

 lo_factory = cl_fdt_factory=>if_fdt_factory~get_instance( ).

 lo_application = lo_factory->get_application( ).

 lo_application->if_fdt_transaction~enqueue( ).

 lo_application->set_development_package( '$TMP' ).

 lo_application->if_fdt_admin_data~set_name( 'PRICING' ).

 lo_application->if_fdt_admin_data~set_texts(

 iv_short_text = 'Pricing' ).

 lo_application->if_fdt_transaction~activate(

     IMPORTING et_message           = lt_message

               ev_activation_failed = lv_boolean ).

 write_errors lt_message.

 lo_application->if_fdt_transaction~save( ).

 lo_application->if_fdt_transaction~dequeue( ).

 lo_factory = cl_fdt_factory=>if_fdt_factory~get_instance(

 iv_application_id = lo_application->mv_id ).

 BREAK-POINT.

 WRITE:/ lo_application->mv_id.

记下输出的application id: FA163E8EAB031EE48B80D14409724BFF


使用BRF+ tcode打开BRF work bench:


利用如下搜索条件查找刚刚创建好的application:


image.png

找到匹配的application. 点击expand button查看header信息:

image.png



ID和report里输出一致,证明这就是report里刚刚创建的application:


image.png


相关文章
|
JSON 数据格式
UE4 structure and JSON conversion - DTBPJson plugin description
UE4 structure and JSON conversion - DTBPJson plugin description
89 0
|
XML 数据格式
SAP Fiori Elements - smart control demo1 currency field - how is manifest.json loaded
SAP Fiori Elements - smart control demo1 currency field - how is manifest.json loaded
124 0
SAP Fiori Elements - smart control demo1 currency field - how is manifest.json loaded
Cannot add product to Opportunity in Fiori - RFC error
Cannot add product to Opportunity in Fiori - RFC error
111 0
Cannot add product to Opportunity in Fiori - RFC error
SAP Fiori application do filtering will real delete note in DB
SAP Fiori application do filtering will real delete note in DB
120 0
SAP Fiori application do filtering will real delete note in DB
|
XML 数据格式
SAP Fiori Elements - object detail batch roundtrip triggered by binding property in embedded xml vie
SAP Fiori Elements - object detail batch roundtrip triggered by binding property in embedded xml vie
106 0
SAP Fiori Elements - object detail batch roundtrip triggered by binding property in embedded xml vie
How to render S4 Code List extension field into CRM WebUI product search view
This question is asked by Wade. Suppose I have created one extension field in S4 with type CodeList which contains all possible queue type supported by JDK. This extension field must be exposed to CRM Product Search WebUI. POC is done in X3C/504:
How to render S4 Code List extension field into CRM WebUI product search view