Application Development and Automation 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: 
Read only

sending flat file using custom idoc

Former Member
0 Likes
450

hi,

While sending flat file using custom idoc both outbound side and inbound side working properly but last record showing in table .

For example 3 records in file but displaying 3rd record in table.

can u solve this problem?

Regards,

Swapna

Edited by: swapna2020 on Aug 31, 2010 3:18 PM

hi,

While sending flat file using custom idoc both outbound side and inbound side working properly but last record showing in table .

For example 3 records in file but displaying 3rd record in table.

can u solve this problem?

Regards,

Swapna

Edited by: swapna2020 on Aug 31, 2010 3:18 PM

2 REPLIES 2
Read only

Former Member
0 Likes
420

Hi,

Let us know how you are populating data? I believe there can be a problem while populating your IDOC segment.

If you have solved, please close this Thread and let community know what was the reason? might be helpful for others.

Rgds,

Mayank

Read only

0 Likes
420

HI,

I didnt get solution for my question.If i check in table inbound side its showing only last record.In this example 2nd record.

For example this my flat file:

100 IN SWAPNA BANGALORE REG BANGALORE

200 IN SEEMA HYD REG HYD

I am populating using upload function module.

CALL FUNCTION 'F4_FILENAME'

IMPORTING

FILE_NAME = p_file.

move p_file to v_file.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = v_file

FILETYPE = 'ASC'

HAS_FIELD_SEPARATOR = 'X'

TABLES

DATA_TAB = T_ZZVENDOR.

IF SY-SUBRC <> 0.

MESSAGE E398(00) WITH 'No Customers Found'.

ENDIF.

Inbound side function module.

INCLUDE MBDCONWF.

TABLES : ZZVENDOR. "Cutomer Header

***Data

DATA : W_ZVENDOR_SEG1 LIKE ZVENDOR_SEG1.

DATA : T_ZZVENDOR LIKE ZZVENDOR OCCURS 0 WITH HEADER LINE.

WORKFLOW_RESULT = C_WF_RESULT_OK.

LOOP AT IDOC_CONTRL.

IF IDOC_CONTRL-MESTYP NE 'ZVENDOR_MSG'.

RAISE WRONG_FUNCTION_CALLED.

ENDIF.

  • Before reading a new entry, clear application buffer

LOOP AT IDOC_DATA WHERE DOCNUM EQ IDOC_CONTRL-DOCNUM.

W_ZVENDOR_SEG1 = IDOC_DATA-SDATA.

MOVE-CORRESPONDING W_ZVENDOR_SEG1 TO T_ZZVENDOR.

INSERT INTO ZZVENDOR VALUES W_ZVENDOR_SEG1.

ENDLOOP.

UPDATE ZZVENDOR FROM T_ZZVENDOR.

IF SY-SUBRC EQ 0.

IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.

IDOC_STATUS-STATUS = '53'.

IDOC_STATUS-MSGTY = 'I'.

IDOC_STATUS-MSGID = 'YM'.

IDOC_STATUS-MSGNO = '004'.

IDOC_STATUS-MSGV1 = T_ZZVENDOR-LIFNR.

APPEND IDOC_STATUS.

CLEAR IDOC_STATUS.

ELSE.

IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.

IDOC_STATUS-STATUS = '51'.

IDOC_STATUS-MSGTY = 'E'.

IDOC_STATUS-MSGID = 'YM'.

IDOC_STATUS-MSGNO = '005'.

IDOC_STATUS-MSGV1 = T_ZZVENDOR-LIFNR.

APPEND IDOC_STATUS.

CLEAR IDOC_STATUS.

WORKFLOW_RESULT = C_WF_RESULT_ERROR.

RETURN_VARIABLES-WF_PARAM = 'Error_Idocs'.

RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.

APPEND RETURN_VARIABLES.

CLEAR RETURN_VARIABLES.

ENDIF.

ENDLOOP.

endfunction.

experts help me out this problem.

Regards,

Swapna

Edited by: swapna2020 on Sep 3, 2010 10:28 AM