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: 

commit work is not working in EXIT_SAPLVEDA_002

carlos_zhang3
Participant
0 Kudos

Dear Guru ,

We are trying to record the log into one "Z" table during the EXIT_SAPLVEDA_002 FM running . And we found that is impossible to write data into the table .

Has someone can give me some suggestions for this ?

Thanks .

Best Regards,

Carlos

1 ACCEPTED SOLUTION

SuhaSaha
Advisor
Advisor
0 Kudos

Hello Carlos,

Remember this thumb rule. "Do not use COMMIT statements in Customer Enhancements". Why? This will end the current SAP LUW which is definitely the last thing you wanted! Please note this is a "thumb rule" & may not be applicable for all enhancements.

Anyway back to your question, why do you want to COMMIT the changes in the Exit? You could wait for the entire transaction to be completed before the entries are commited to the DB.

BR,

Suhas

6 REPLIES 6

SuhaSaha
Advisor
Advisor
0 Kudos

Hello Carlos,

Remember this thumb rule. "Do not use COMMIT statements in Customer Enhancements". Why? This will end the current SAP LUW which is definitely the last thing you wanted! Please note this is a "thumb rule" & may not be applicable for all enhancements.

Anyway back to your question, why do you want to COMMIT the changes in the Exit? You could wait for the entire transaction to be completed before the entries are commited to the DB.

BR,

Suhas

0 Kudos

hi Suhas,

Thanks for your replied .

The problem is when ORDERS05 ( IDOC message ) incoming to our sap system , the Sales Order can not be generated .

And we found there have a lot of material that didn't exist in our sap system and we want to record those material number into one table to show to the user after .

Hope you have a good idea for that .

Thanks again .

Best Regards,

Carlos

0 Kudos

Hi,

you can fill your data to a work area (or internal table) and pass it to a fm which you have to write. Call this fm (e.g. ZTAB_UPDATE) in update task and fill your z-table from work area (or table) you passed as parameter to the fm.

CALL FUNCTION ZTAB_UPDATE IN UPDATE TASK
 EXPORTING ZTABLINE = wa_ztab.

or

CALL FUNCTION ZTAB_UPDATE IN UPDATE TASK
 TABLES ZTAB = iztab.

In the fm you should insert the table entries with MODIFY ZTAB FROM ztabline or MODIFY ZTAB FROM TABLE ztab to avoid dumps from duplicates.

Regards,

Klaus

Edited by: Klaus Babl on Mar 17, 2011 8:00 AM

0 Kudos

Hi Klaus ,

I tried this , but it didn't work . Is FM must be to 'Remote Enable Module' ?

Thanks .

Best Regards,

Carlos

0 Kudos

No, it is an "Update Module" (The option under Remote-Enabled Module)!

Regards,

Klaus

Edited by: Klaus Babl on Mar 17, 2011 8:36 AM

Former Member
0 Kudos

Processing function module IDOC_INPUT_ORDERS does the standard validations and populate the error messages in ERRTAB. The errors mentioned by you (invalid material numbers) are part of standard valudation and will be populated in ERRTAB. Neither a COMMIT WORK or processing of sales order transaction (Call transation VA01 lines from 117 to 148) is carried out when the lines in ERRTAB is more than 0 (Line Number 94).

The errors populated in ERRTAB will be shown in the status records of failed IDOC. Based on above situation, I don't think it is possible to update the error messages in Z table.