0 pts.
 IDOC orders05 inbound sales order header and line item text
Hi I have tried unsuccessfully to send any text to the sales order I have used various options with structures E1EDKT1, E1EDKT2 and E1EDPT1 and E1EDPT2 can some tell me how to create text do you use both E1EDKT1 & E1EDPT2 any help most appreciated.

Software/Hardware used:
ASKED: November 15, 2005  10:31 PM
UPDATED: May 5, 2010  4:30 PM

Answer Wiki:
You can create the long text from se75, or you can use following codes for creating a long text. ensure that you are using tdobject 'VBBP' and tdname vbeln+posnr and tdid as per your convinience then you can able to transport your text thru idoc. REPORT ZGNS25 . DATA: NAME LIKE STXH-TDNAME , TXTFLG . DATA : BEGIN OF TEXT_LINES OCCURS 0. INCLUDE STRUCTURE TLINE . DATA : END OF TEXT_LINES. DATA : EDIT_MODE. DATA : BEGIN OF HEAD . INCLUDE STRUCTURE THEAD. DATA : END OF HEAD. DATA : BEGIN OF OUTPUT . INCLUDE STRUCTURE ITCER. DATA : END OF OUTPUT. NAME = [vbeln+posnr ] EDIT_MODE = ' '. CALL FUNCTION 'READ_TEXT' EXPORTING CLIENT = SY-MANDT ID = 'F001' LANGUAGE = SY-LANGU NAME = NAME OBJECT = 'VBBP' * ARCHIVE_HANDLE = 0 IMPORTING HEADER = HEAD TABLES LINES = TEXT_LINES EXCEPTIONS ID = 1 LANGUAGE = 2 NAME = 3 NOT_FOUND = 4 OBJECT = 5 REFERENCE_CHECK = 6 WRONG_ACCESS_TO_ARCHIVE = 7 OTHERS = 8. IF HEAD IS INITIAL. MOVE : 'MATERIAL' TO HEAD-TDOBJECT, NAME TO HEAD-TDNAME, * 'Z001' to head-tdid, * P_LTEXT_ID TO HEAD-TDID, 'GRUN' TO HEAD-TDID, SY-LANGU TO HEAD-TDSPRAS, SY-UNAME TO HEAD-TDFUSER, '00001' TO HEAD-TDVERSION, SY-DATUM TO HEAD-TDFDATE, SY-UZEIT TO HEAD-TDFTIME, SY-MANDT TO HEAD-MANDT, SY-UNAME TO HEAD-TDLUSER, SY-DATUM TO HEAD-TDLDATE, SY-UZEIT TO HEAD-TDLTIME. TXTFLG = '1'. MOVE '*' TO TEXT_LINES. APPEND TEXT_LINES. CALL FUNCTION 'INSERT_TEXT_AFTER_COMMIT' EXPORTING HEADER = HEAD TABLES LINES = TEXT_LINES EXCEPTIONS OTHERS = 1. ELSE. MOVE : '00001' TO HEAD-TDVERSION, SY-UNAME TO HEAD-TDLUSER, SY-DATUM TO HEAD-TDLDATE, SY-UZEIT TO HEAD-TDLTIME. TXTFLG = '0'. ENDIF. CALL FUNCTION 'EDIT_TEXT' EXPORTING DISPLAY = EDIT_MODE * EDITOR_TITLE = ' ' HEADER = HEAD * save = 'X' * CONTROL = ' ' IMPORTING * FUNCTION = NEWHEADER = HEAD RESULT = OUTPUT TABLES LINES = TEXT_LINES EXCEPTIONS ID = 1 LANGUAGE = 2 LINESIZE = 3 NAME = 4 OBJECT = 5 TEXTFORMAT = 6 COMMUNICATION = 7 OTHERS = 8. *if txtflg = '1'. CALL FUNCTION 'UPDATE_TEXT_AFTER_COMMIT' EXPORTING HEADER = HEAD TABLES LINES = TEXT_LINES EXCEPTIONS OTHERS = 1.
Last Wiki Answer Submitted:  December 5, 2005  3:28 am  by  Sarmalkar   0 pts.
All Answer Wiki Contributors:  Sarmalkar   0 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

There is a routine that exists that SAP put in the program but does not execute. The memory tables are loaded naturally buy SAP(when using E1EDKT1, E1EDKT2, EDEDPT1, and E1EDPT2). There are two exits that need to be utilized. SAP does not store VBAP-POSEX in the first exit so you will need to move VBAP-POSNR, which is 000001 before it is translated to 000010 later in the process(000002 to 000020, 000003 to 000030, etc.) to VBAP-POSEX in the first exit(EXIT_SAPLVEDA_001). See code below.

data: c_e1edp01 like edidd-segnam value ‘E1EDP01′,
ls_vbap like xvbap.

if segment-segnam eq c_e1edp01 and
ls_vbak-auart = ‘ZAR ‘.

ls_vbap = dxvbap.

ls_vbap-posex = ls_vbap-posnr.

dxvbap = ls_vbap.

endif.

VBAP-POSEX will then will populate the EDEDPT2-POSEX when the EDEDPT2 segment is encountred in the process. After the sales order is created use user exit EXIT_SAPLVEDA_003. This is called upon creation of the sales order. Make sure there is a sales order document number present. See code below.

case sales_document.
when ‘ ‘.

exit.

when others.

perform text_create(saplveda).

Routine text_create is present to load the text tables with the EDEDKT1, EDEDKT2, EDEDPT1, EDEDPT2 data it is just never called. Hope this helps! Thanks!

 20 pts.

 

Leave out the “and ls_vbak-auart = ‘ZAR ‘”. It is specific to what I am doing. Sorry!

 20 pts.