Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Text is not uploading for co03 ( Andreas)

Former Member
0 Kudos

hi friends ihave done a text upload program for production order co03 i did it and in log file its created and also in debug sy0subrc = 0 but when i want to see the uploaded text it doesnt appear in co03..pls help me out its urgent

its overwriting the existing text

regards and thanks in advance .

following is the code

LOOP AT isales_text.

ilines-tdline = isales_text-tDLINE.

APPEND ilines.

AT END OF TDid.

PERFORM cr_text.

REFRESH ilines.

ENDAT.

ENDLOOP. " loop at isales_text

FORM cr_text.

  • REFRESH ilines.

  • SPLIT isales_text-ttext AT '|' INTO TABLE i_line.

  • LOOP AT i_line.

  • ilines-tdline = i_line-tdline.

  • APPEND ilines.

  • ENDLOOP.

IF NOT ilines[] IS INITIAL.

thead-tdid = isales_text-tdid.

  • UNPACK isales_text-aufnr TO isales_text-aufnr.

CONCATENATE sy-mandt isales_text-aufnr INTO THEAD-TDNAME .

thead-tdobject = 'AUFK'.

CALL FUNCTION 'CREATE_TEXT'

EXPORTING

fid = thead-tdid

flanguage = sy-langu

fname = thead-tdname

fobject = thead-tdobject

  • SAVE_DIRECT = 'X'

  • FFORMAT = '*'

TABLES

flines = ilines

EXCEPTIONS

no_init = 1

no_save = 2

OTHERS = 3.

IF sy-subrc <> 0.

ilog-aufnr = isales_text-aufnr.

ilog-msgcode = 'ERROR_HDR_TEXT'.

ELSE.

ilog-aufnr = isales_text-aufnr.

ilog-msgcode = 'CREATED_HDR_TEXT'.

ENDIF. " IF sy-subrc <> 0 .

APPEND ilog.

ENDIF.

ENDFORM.

hi vinod and ravi thnks for reply ...

but iused all ur suggestion but its not working i did call the functions in form and as well as tried in loop too but its not working..

waiting for remedies.

farukh

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Did you try my last post ?

<b>

In the debug mode look at the values you are passing to CREATE_TEXT and make a note. Now go to SE37, run READ_TEXT and give the exact parameters that you got in the debug mode. Does it return values?

If yes, then the values that CO03 uses are different.

</b>

Regards,

Ravi

4 REPLIES 4

Former Member
0 Kudos

Did you try my last post ?

<b>

In the debug mode look at the values you are passing to CREATE_TEXT and make a note. Now go to SE37, run READ_TEXT and give the exact parameters that you got in the debug mode. Does it return values?

If yes, then the values that CO03 uses are different.

</b>

Regards,

Ravi

leonardo_pavia
Participant
0 Kudos

Hi Farukh, did you solve this problem?, i have this problem and i don't know wath to do?

Thanks...

0 Kudos

Yes , i did solve the problem ..but not in a logical way i was suppose to give the report as soon as possible so i did in very different way ..

what happens in co01 is whenever there is some data exits then u will c that the data will be overwrite the previous and u can c the new data what is the reason for that i dont know ??? if u find then tell me too?

i solved my problem in diffenet way i used bdc before inserting the text .using bdc i uploaded some dummy data and then in same program i had uploaded the text here is the code hope u will be help full. if yes then ..pls rewards points .

**before this for bdc u have to call gui_upload

LOOP AT itxt.

MOVE itxt TO wa_txt.

  • ilines-tdformat = '*'.

ilines-tdformat = itxt-tdformat.

ilines-tdline = itxt-tdline.

APPEND ilines.

AT END OF aufnr.

PERFORM co02_change_text.

UNPACK itxt-aufnr TO itxt-aufnr.

CONCATENATE sy-mandt itxt-aufnr INTO w_name.

CLEAR: ilines.

CALL FUNCTION 'CREATE_TEXT'

EXPORTING

fid = wa_txt-tdid

flanguage = sy-langu

fname = w_name

fobject = wa_txt-tdobject

save_direct = 'X'

  • fformat = itxt-tdformat

TABLES

flines = ilines

EXCEPTIONS

no_init = 1

no_save = 2

OTHERS = 3.

IF sy-subrc <> 0.

ilog-aufnr = itxt-aufnr.

ilog-msgcode = 'ERROR_HDR_TEXT'.

ELSE.

ilog-aufnr = itxt-aufnr.

ilog-msgcode = 'CREATED_HDR_TEXT'.

ENDIF. " IF sy-subrc <> 0 .

APPEND ilog.

CLEAR ilines[].

ENDAT.

ENDLOOP. "ITXT

MOVE p_efname TO w_filename.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

  • BIN_FILESIZE =

filename = w_filename

  • FILETYPE = 'ASC'

  • APPEND = ' '

write_field_separator = 'X'

  • HEADER = '00'

  • TRUNC_TRAILING_BLANKS = ' '

  • WRITE_LF = 'X'

  • COL_SELECT = ' '

  • COL_SELECT_MASK = ' '

  • IMPORTING

  • FILELENGTH =

TABLES

data_tab = ilog

EXCEPTIONS

file_write_error = 1

no_batch = 2

gui_refuse_filetransfer = 3

invalid_type = 4

no_authority = 5

unknown_error = 6

header_not_allowed = 7

separator_not_allowed = 8

filesize_not_allowed = 9

header_too_long = 10

dp_error_create = 11

dp_error_send = 12

dp_error_write = 13

unknown_dp_error = 14

access_denied = 15

dp_out_of_memory = 16

disk_full = 17

dp_timeout = 18

file_not_found = 19

dataprovider_exception = 20

control_flush_error = 21

OTHERS = 22

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

WRITE:/ 'Records Uploaded'.

&----


*& Form co02_change_text

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM co02_change_text.

PERFORM bdc_dynpro USING 'SAPLCOKO1' '0110'.

PERFORM bdc_field USING 'BDC_CURSOR'

'CAUFVD-AUFNR'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'CAUFVD-AUFNR'

wa_txt-aufnr. "'1039856'.

PERFORM bdc_field USING 'R62CLORD-FLG_OVIEW'

'X'.

  • PERFORM bdc_dynpro USING 'SAPLCOKO1' '0115'.

  • PERFORM bdc_field USING 'BDC_OKCODE'

  • '=TEXT'.

  • PERFORM bdc_field USING 'BDC_CURSOR'

  • 'CAUFVD-GAMNG'.

PERFORM bdc_dynpro USING 'SAPLCOKO1' '0115'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=LATX'.

PERFORM bdc_dynpro USING 'SAPLSTXX' '1100'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RSTXT-TXLINE(02)'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=TXBA'.

PERFORM bdc_field USING 'RSTXT-TXLINE(02)'

'HEADER TEXT'.

PERFORM bdc_dynpro USING 'SAPLCOKO1' '0115'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=BU'.

PERFORM bdc_transaction USING 'CO02'.

ENDFORM. " co02_change_text

0 Kudos

Farukh, wonderful help!!!, the problem was solved. How can i reward you points?, if you want, post a reply to topic "Creating Text for co01" about this problem posted by me yesterday

Thank you very much!!!!