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

Idoc modification

Former Member
0 Likes
1,554

Hi,

I have a requirement where the idoc for invoice is received from external system.( Inbound process ).While it is processed in the sap system the data has to be validated. And if the data is invalid then this detail has to be maintained in the ztable with the idoc status "Incorrect" and message "reasoning the error" and related data.

And in the program the details of the idoc whose status is incorrect(that is maintained in the ztable) has to be displayed so that the user changes( corrects ) the idoc data and "SAVE"s it. When it is saved the modified data has to be updated in the idoc and a ztable.

The data that is displayed can be header or item data or both.. Therefore both kind of data has to be updated for a particular idoc..

Can anyone help me in giving information as how to update the idoc in this scenario?

Thanks & Regards,

Lakshmi

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,439

Solution: Copy the Standard idoc to the Z_idoc name and then this has to confrigured by the Function cons. once it done then goto the FM module Copy one and write the code what u want to u please tell me know if u want any help is need from my side.....i have done this scenario..

13 REPLIES 13
Read only

Former Member
0 Likes
1,439

Hi Lakshmi,

I have done the same req with HR IDOCs.

You have to change the Inbound Function module as per your req by copying the standard function module.

It should be the remote FM where u can put a piece of code for validation before updating the data. AT the same time u can trace the errors and update it in the ZTABLE.

Dont forget to assign this custom FM for the message type in WE57 after everything over.

Thanks

Eswar

Read only

0 Likes
1,439

Hi Eswar,

Thanks for your instant reply. But i would like to know as which function module does this. My invoices are both FI and MM.

Regards,

Lakshmi

Read only

0 Likes
1,439

hi,

FI invoice document will be created by IDOC_INPUT_INVOIC_FI and MM inovice document is created by IDOC_INPUT_INVOIC_MM. so you need to copy these two FM and add your code.

rajkumar abbu

Read only

0 Likes
1,439

Hi Lakshmi,

Modify the below FModules

IDOC_INPUT_INVOIC_FI Invoice Receipt (INVOICE)

IDOC_INPUT_INVOIC_MM Invoice Receipt (INVOICE)

Thanks

Eswar

Read only

Former Member
0 Likes
1,440

Solution: Copy the Standard idoc to the Z_idoc name and then this has to confrigured by the Function cons. once it done then goto the FM module Copy one and write the code what u want to u please tell me know if u want any help is need from my side.....i have done this scenario..

Read only

Former Member
0 Likes
1,439

Hi,

Please go throught his code it will help u lot ..... what i am doing is that i am copy the status into aninternal ... and what u have do same if i am right please tell me know once it done

FUNCTION z_idoc_status_zinfinfo_gc3.

*"----


""Local interface:

*" IMPORTING

*" REFERENCE(RCVPRN) TYPE EDI_RCVPRN

*" REFERENCE(RCVPOR) TYPE EDI_RCVPOR

*" REFERENCE(RCVPRT) TYPE EDI_RCVPRT

*" REFERENCE(MESCOD) TYPE EDI_MESCOD

*" REFERENCE(MESTYP) TYPE EDI_MESTYP

*"----


DATA: w_e1stats LIKE e1stats.

DATA: t_idoc_data LIKE TABLE OF edidd WITH HEADER LINE.

DATA : w_docnum TYPE edi_docnuc,

w_logdat TYPE edi_logdat,

w_logtim TYPE edi_logtim.

CONSTANTS: c_status TYPE edi_status VALUE '53',

c_statyp TYPE edi_symsty VALUE 'S'.

idoc_control-mestyp = c_mestyp_status.

idoc_control-idoctp = c_idoctp_stat01.

idoc_control-rcvprt = rcvprt.

idoc_control-rcvprn = rcvprn.

Read only

Former Member
0 Likes
1,439

Hi,

i posted only a OFF code above if want every thing can u please mail me vishu_sai9@yahoo.com and i will send the completed code to u

Read only

Former Member
0 Likes
1,439

Hi,

i have done same thing in my project please tell me if i can help out if u an issue thank u

Read only

Former Member
0 Likes
1,439

Hi,

i have done same thing in my project please tell me if i can help out if u an issue thank u

Read only

Former Member
0 Likes
1,439

Hi,

I got the solution as how to modify the idoc data. The FMs used for this application are:

EDI_DOCUMENT_OPEN_FOR_EDIT - To get the idoc data

EDI_CHANGE_DATA_SEGMENTS - To change the idoc data

EDI_DOCUMENT_CLOSE_EDIT - To close

Regards,

Lakshmi

Read only

0 Likes
1,439

Hi lakshmi,

U did in a different point of view that's great thank u friend ......

Read only

0 Likes
1,439

Hi Lakshmi,

Thanks for update.

Can u please close this thread by giving some points for helpful answers.

Thanks

Eswar

Read only

0 Likes
1,439

Hi lakshmi,

I have few doubts about the Idoc modification can u please clarify my doubt, if it great for me if u provided me an email id to me and i am waiting for u reply

thank u

kiranprasad