‎2009 Sep 01 8:48 AM
Hi All,
I am trying to create a salesorder with using bapi BAPI_SALESORDER_CREATEFROMDAT2 every thing is processing sucessfully but if i add these structures ( BAPICUCFG,BAPICUINS, and BAPICUPRT, BAPICUVAL ) for order creation i am not able to create the order, Please provide me some information or documentation about this issue.**
Regards,
Kalyan Chakravarthy K
‎2009 Sep 01 2:28 PM
Hello,
Try this Code..
CU: Configuration Data
CLEAR: t2bapicucfg.
MOVE cfg1_posnr TO t2bapicucfg-posex.
MOVE cfg1_posnr TO t2bapicucfg-config_id.
MOVE '00000001' TO t2bapicucfg-root_id.
MOVE sy-langu TO t2bapicucfg-kblanguage.
APPEND t2bapicucfg.
Instances of several configurations
CLEAR: t2bapicuins.
MOVE cfg1_posnr TO t2bapicuins-config_id.
MOVE '00000001' TO t2bapicuins-inst_id.
MOVE 'MARA' TO t2bapicuins-obj_type.
MOVE klah_scat-class TO t2bapicuins-obj_key.
MOVE klah_scat-klart TO t2bapicuins-class_type.
APPEND t2bapicuins.
CU: Reference Order Item / Instance in Configuration
CLEAR: t2bapicuref.
MOVE cfg1_posnr TO t2bapicuref-posex.
MOVE cfg1_posnr TO t2bapicuref-config_id.
MOVE '00000001' TO t2bapicuref-inst_id.
APPEND t2bapicuref.
Default Values for Class
LOOP AT t2cval.
CLEAR: t2bapicuval.
MOVE cfg1_posnr TO t2bapicuval-config_id.
MOVE '00000001' TO t2bapicuval-inst_id.
MOVE t2cval-atnam TO t2bapicuval-charc.
MOVE t2cval-atwrt TO t2bapicuval-value.
APPEND t2bapicuval.
ENDLOOP.
Regards,
Krishna.
‎2009 Sep 02 9:26 AM