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 idoc data ?

former_member321825
Active Participant
0 Kudos

Hi,

I have downloaded idoc in text file

1. for this i have passed the document number in IDOC_READ_COMPLETELY.

2. from the above i got the control records and data records .

3. i have appended both in internal table.

4. then i have downloaded in flat file.

5. the user requirement is the downlaoded file can be modified and again i need to upload.

6 . my question is how to read the uploaded data in flat file.( all data comes in one column , how to separate control record and data record)

7. how to know what data has been updated in flat file.

Please help me to resolve the above prob..

My code :

data :

IT_data TYPE ZTABLE , "(line type char (1063)

wa_data LIKE LINE OF IT_DATA.

MOVE-CORRESPONDING WA_IDOC_CONTROL TO WA_EDI_DC40. " control record

WA_EDI_DC40-TABNAM = 'EDI_DC40'.

WA_EDI_DC40-IDOCTYP = WA_IDOC_CONTROL-IDOCTP.

WA_itab = WA_EDI_DC40.

APPEND WA_itab TO IT_itab.

LOOP AT IT_EDIDD INTO WA_EDIDD. " data record

MOVE-CORRESPONDING WA_EDIDD TO WA_EDI_DD40.

WA_itab= WA_EDI_DD40.

APPEND WA_itab TO IT_itab

ENDLOOP.

Regards,

Rachel

2 REPLIES 2

brad_bohn
Active Contributor
0 Kudos

It sounds like you either haven't downloaded it correctly or the user isn't maintaining the integrity of the file. If you keep the CRLF's intact, then it's not an issue. The upload and read should be easy, whether it's local or from the app server.

uwe_schieferstein
Active Contributor
0 Kudos

Hello Rachel

I would use the XML format to export and import your IDoc data (e.g. upload via fm IDOC_XML_FROM_FILE).

The XML-IDoc is quite readable for proficient users who need to modify its contents.

And a simple XML diff analysis between the original and modified XML-IDoc will show you every change in detail.

Regards

Uwe