DATA: BEGIN OF s_head, order_id LIKE z1crm_sales_head-order_id, status_h LIKE z1crm_sales_head-status_h, creat_date_h LIKE z1crm_sales_head-creat_date_h, creat_time_h LIKE z1crm_sales_head-creat_time_h, sold_to LIKE z1crm_sales_head-sold_to, ship_to LIKE z1crm_sales_head-ship_to, cont_total LIKE z1crm_sales_head-cont_total, zzroute LIKE z1crm_sales_head-zzroute, ship_cond LIKE z1crm_sales_head-ship_cond, pmnttrms LIKE z1crm_sales_head-pmnttrms, END OF s_head, itab_head LIKE STANDARD TABLE OF s_head.
DATA: BEGIN OF s_item, itemcode LIKE z1crm_sales_item-number_int, pn_group LIKE z1crm_sales_item-pn_group, matnr LIKE z1crm_sales_item-matnr, charg LIKE z1crm_sales_item-charg, status_i LIKE z1crm_sales_item-status_i, END OF s_item, itab_item LIKE STANDARD TABLE OF s_item.
DATA: BEGIN OF adminfo, object TYPE string, version TYPE string, END OF adminfo, p_info LIKE STANDARD TABLE OF adminfo.
DATA: BEGIN OF it_xml OCCURS 0, line(100) TYPE c, END OF it_xml. DATA: w_xml TYPE string, w_len TYPE i. PARAMETERS:order_id LIKE z1crm_sales_head-order_id DEFAULT '8895100207'.
*&---------------------------------------------------------------------* *& Form getdata *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* FORM getdata . REFRESH:itab_head,itab_item. SELECT * INTO CORRESPONDING FIELDS OF TABLE itab_head FROM z1crm_sales_head WHERE order_id = order_id. READ TABLE itab_head INTO s_head INDEX 1.
SELECT number_int AS itemcode pn_group matnr charg status_i INTO CORRESPONDING FIELDS OF TABLE itab_item FROM z1crm_sales_item WHERE order_id = order_id.
adminfo-object = '17'. adminfo-version = '2'.
ENDFORM. " getdata *&---------------------------------------------------------------------* *& Form create_xml *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* FORM create_xml . CALL TRANSFORMATION z1766test01 SOURCE p_info = adminfo header = itab_head item = itab_item RESULT XML w_xml.
CALL FUNCTION 'SCMS_STRING_TO_FTEXT' EXPORTING text = w_xml IMPORTING length = w_len TABLES ftext_tab = it_xml.