07-29-2010 10:45 AM
Hi,
I am trying to make a BDC for SAVE_TEXT for transaction code VF02.I used the following code:
LOOP AT IT INTO WA.
IF SY-SUBRC 0. EXIT. ENDIF.
PERFORM BDC_DYNPRO USING 'SAPMV60A' '0101'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'VBRK-VBELN'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'VBRK-VBELN'
WA-VBELN_001.
PERFORM BDC_DYNPRO USING 'SAPMV60A' '0104'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'VBRK-FKART'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=KFDE'.
PERFORM BDC_DYNPRO USING 'SAPMV60A' '6001'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=KFTE'.
PERFORM BDC_DYNPRO USING 'SAPMV60A' '6001'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=SICH'.
PERFORM BDC_FIELD USING 'LV70T-SPRAS'
'E'.
initial data.
THEAD-TDOBJECT = 'VBBK'.
THEAD-TDID = '0002'.
THEAD-TDSPRAS = SY-LANGU.
THEAD-TDNAME = '90000080'.
Lines
TLINE-TDFORMAT = '*'.
TLINE-TDLINE = 'Test data'.
APPEND TLINE.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
HEADER = THEAD
SAVEMODE_DIRECT = 'X'
TABLES
LINES = TLINE
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
OBJECT = 4
OTHERS = 5.
IF SY-SUBRC = 0.
WRITE: / 'Successful'.
COMMIT WORK.
ENDIF.
PERFORM BDC_TRANSACTION USING 'VF02'.
ENDLOOP.
PERFORM CLOSE_GROUP.
After doing this,data is getting saved in tables STXH and STXL but when i tried to see the saved text in transaction code VF02.I am unable to see the saved text.
Please help me out.
Regards,
Praveen
07-29-2010 10:50 AM
Hi,
First of all, BDC Call is not necessary if you are updating only the Text data using SAVE_TEXT. Instead, call SAVE_TEXT within the LOOP. Moreover, in code specified, you are passing the hardcoded value into the parameter THEAD-TDNAME. You should pass the value WA-VBELN_001 to this parameter.
Regards
Vinod
07-29-2010 10:50 AM
Hi,
First of all, BDC Call is not necessary if you are updating only the Text data using SAVE_TEXT. Instead, call SAVE_TEXT within the LOOP. Moreover, in code specified, you are passing the hardcoded value into the parameter THEAD-TDNAME. You should pass the value WA-VBELN_001 to this parameter.
Regards
Vinod
07-29-2010 10:52 AM
Dear Vinod,
Thanks for your answer.
I tried all the tricks without BDC as well.
Its not working as it is not showing in VF02.
Regards,
Praveen
07-29-2010 11:02 AM
Hi,
Try this sample code,
data: headerl like thead occurs 0 with header line.
data itab3 like tline occurs 0 with header line.
headerl-tdobject = 'VBBK'.
headerl-tdname = '0090000080'. "use conversion routine to change from 8 digits to 10 digits"
headerl-tdid = '0002'.
headerl-tdspras = 'E'.
append headerl.
move '*' to itab3-tdformat.
move 'INVOICE TEXT' to itab3-tdline.
append itab3.
call function 'SAVE_TEXT'
exporting
header = headerl
insert = 'X' "Added"
savemode_direct = 'X'
tables
lines = itab3
exceptions
id = 1
language = 2
name = 3
object = 4
others = 5.
Regards
Vinod