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: 

how to upload new created vendor in open dataset using badi VENDOR_ADD_DATA for XK01

0 Kudos
405
 method IF_EX_VENDOR_ADD_DATA~CHECK_ALL_DATA.
Data: file(40).
CONCATENATE 'SY-HOST' '/usr/sap/DPK/DVEBMGS96/data/DEMO.txt' into file.
data: itab TYPE TABLE OF LFA1.
data:wa LIKE LINE OF itab.
open DATASET file for APPENDING in TEXT MODE ENCODING DEFAULT.
if SY-SUBRC = 0.
LOOP at itab into wa.
transfer wa to FILE.
ENDLOOP.
endif.
close DATASET file.
endmethod.
4 REPLIES 4

Sandra_Rossi
Active Contributor
0 Kudos
275

Please edit your question, select your code and click the button CODE so that it's nicely displayed and people can read it easily.

FredericGirod
Active Contributor
0 Kudos
275

Why did you put the SY-HOST at the beggining of a file path ?

Sandra_Rossi
Active Contributor
0 Kudos
275

So, you're talking about BAdI VENDOR_ADD_DATA.

Your code appends some text to a file.

Please detail your question "how upload created vendor"? What do you want to do exactly?

raymond_giuseppi
Active Contributor
0 Kudos
275

What exactly do you want to do, append every updated vendor to a file on server, how will this data be later processed, etc.