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: 

interface using idoc..creating function module??

Former Member
0 Kudos
112

Iam trying to do an interface with idocs.just tryin to put some default values before uploading to sap.

iam creating a function module with input and output parameters as same as that of IDOC_INPUT_ACC_BILLING.

Iam declaring sements like this..

E1BPACHE01 like E1BPACHE01,

E1BPACAR01 like E1BPACAR01,

E1BPACGL01 like E1BPACGL01,

E1BPACCR01 LIKE E1BPACCR01,

wa_control like line of IDOC_CONTRL,

wa_data like line of IDOC_data,

I_EDIDD TYPE ZEDIDD.

REFRESH I_EDIDD.

adding data to internal table.

LOOP AT IDOC_CONTRL INTO WA_CONTROL.

LOOP AT IDOC_DATA into wa_data WHERE DOCNUM = WA_CONTROL-DOCNUM.

APPEND wa_DATA TO I_EDIDD.

ENDLOOP.

LOOP AT I_EDIDD INTO wa_DATA.

CASE wa_DATA-SEGNAM.

WHEN 'E1BPACHE01'.

E1BPACHE01 = wa_DATA-SDATA.

*********

IF E1BPACHE01-COMP_CODE

IS INITIAL.

move '0000' to E1BPACHE01-COMP_CODE.

endif.

*********

like this am checking other segments and changing values of field wat i require.the

then..

endcase.

modify I_EDIDD FROM WA_DATA.

ENDLoop.

ENDLOOP.

then am calling one standard function module IDOC_INPUT_ACC_BILLING for posting purpose.

please help me

the whole scenario described above is not working ..just tell me where i went wrong

2 REPLIES 2

christian_wohlfahrt
Active Contributor
0 Kudos
55

Hi Rendeep!

Normally this is all OK. Maybe some customizing is missing for billing IDOC, so further executing stops somewhere (and you can't find the messages).

Use IDOC_INBOUND_SINGLE. This is best (depending on your release) way to create own (inbound) IDOCs. Then you can check (WE05 or BD87) if IDOCs were created. A seperate problem is to post the IDOCs, but that's then business logic, not any longer partner function details (check WE20 for correct settings).

Regards,

Christian

Former Member
0 Kudos
55

Hi Rendeep,

You are passing the sdata into the corresponding segment work area and changing it but you have not modified data in l_edidd. Also if you want these reflected in your IDoc then it will just not be enough if you change the internal table, you will also have to modify it in EDIDD DBtab.

Let me know in case you need any further information.

Regards,

Srikanth