Skip to Content
0
Former Member
Mar 19, 2007 at 03:56 AM

pass value at run time from one structure to diffrent structure

14 Views

hi experts.

i m workin on crm domain and faching problem to pass value from one stucture to another . problem is that i want the output in xml file so i need all the values interm of segment.

initialy i have this structure.

DATA: BEGIN OF struc1 occurs 0,

ST_ORDERADM_H TYPE CRMT_ORDERADM_H_WRKT,

ST_PRICING TYPE CRMT_PRICING_WRKT,

ST_ORGMAN TYPE CRMT_ORGMAN_WRKT,

ST_PARTNER TYPE CRMT_PARTNER_EXTERNAL_WRKT,

END OF struc1.

and using fm CALL FUNCTION 'CRM_ORDER_READ' i got values on this structure at run time.

MOVE LT_ORDERADM_H to STRUC1-ST_ORDERADM_H.

MOVE LT_ORGMAN to STRUC1-ST_ORGMAN.

MOVE LT_PARTNER to STRUC1-ST_PARTNER.

MOVE LT_PRICING to STRUC1-ST_PRICING.

and after that using

try.

CALL TRANSFORMATION id

SOURCE data_node = STRUC1

RESULT XML xmlstring.

CATCH cx_st_error.

endtry.

CLEAR: tab_xstring,

lv_filename,

lv_path,

lv_fullpath,

lv_user_action.

REFRESH: tab_xstring.

lv_bytes = XSTRLEN( xmlstring ).

IF lv_bytes > 0.

lv_xstring = xmlstring.

DO.

APPEND lv_xstring TO tab_xstring.

lv_xcnt = XSTRLEN( lv_xstring ).

IF lv_xcnt > xsize.

lv_xstring = lv_xstring+xsize.

ELSE.

EXIT.

ENDIF.

ENDDO.

now it convert to xml file .

problem is it gives me value of all field associated with standared structure.

but client requirment is that he want only selected values of given structure.

so i think i make a new structure for given value but i m not able to get values in new structure.

thanks