cancel
Showing results for 
Search instead for 
Did you mean: 

EXIT_SAPMM06E_006 and EXIT_SAPMM06E_008 sample abap code

scottcarricknwn
Participant
0 Kudos

I have created a custom field to appear on Customer Data tab on PO Header. Field is a drop down with fixed values and appears on tab just fine. Problem is I cannot any examples of the ABAP code needed in EXIT_SAPMM06E_006 and EXIT_SAPMM06E_008 that will have data read and write from custom field to CI field in EKKO. Lot's of posts out there but no real examples. Attached is as far as i have gotten. EKKO table has a value in custom field but when screen loads, nothing is displayed. exit-sapmm06e-006-example.pngscreen.png

Accepted Solutions (1)

Accepted Solutions (1)

mateuszadamus
Active Contributor
0 Kudos

Hi scottcarricknwn

Please have a look at this answer. It's a detailed example of a solution for the same issue.

https://answers.sap.com/answers/11938873/view.html

regards,

Mateusz

scottcarricknwn
Participant
0 Kudos

Yes hi, i have seen that post before. 1st of all these statements are false:

4) in include: ZXM06U36 of EXIT_SAPMM06E_008 write this code

ekko_ci = i_ci_ekko

5) in include ZXM06U37 of exit EXIT_SAPMM06E_006 write this code.

e_ci_ekko = ekko_ci.

#4 - There is no i_ci_ekko in that include. I changed it to e_ci_ekko instead.

#5 - No e_ci_ekko in include. Changed to i_ci_ekko instead/

Secondly, followed rest of post, still doenst show on screen or update table ekko.

mateuszadamus
Active Contributor

Hmm, you're right. Here is what I can see:

  1. Function EXIT_SAPMM06E_006 (include ZXM06U36) is for Export Data to Customer Subscreen for Purchasing Document Header (PBO) - here you can assign custom data to EKKO, EKPO and others customer fields.
  2. Function EXIT_SAPMM06E_007 (include ZXM06U38) is for Export Data to Customer Subscreen for Purchasing Document Header (PAI) - you can handle customer command here, if needed.
  3. Function EXIT_SAPMM06E_008 (include ZXM06U37) is for Import Data from Customer Subscreen for Purchasing Document Header - you can move data from customer fields of EKKO to EKKO_CI structure
  4. Function EXIT_SAPMM06E_009 (include ZXM06U39) is for Reset Customer Data at Beginning of New Document (Without Dialog) - you can instantiate and clear all your variables here.
  5. Function EXIT_SAPMM06E_013 (include ZXM06U44) is for Update Customer's Own Data in Purchasing Document - you can save customer data in custome tables in this function.

Hope this helps.

regards,

Mateusz

Edit: Sample codes:

Ad 1.

MOVE-CORRESPONDING i_ekko TO ekko.
ekko-zzcustomer_field = abap_true. " manual assignment, can be based on some conditions for example

Ad 2.

gv_ucomm  = i_ucomm. " store information about custom command for later use

Ad 3.

e_ucomm = gv_ucomm. " send custom command to the transaction
e_ci_update = abap_true. " force update on screen, set by system to true if E_CI_EKKO changed

e_ci_ekko-zzcustomer_field = ekko-zzcustomer_field.

Ad 4.

" clear variables if needed
CLEAR gv_ucomm.

Ad 5.

" save data in a Z* table, if needed, no commit allowed
MODIFY ztable FROM ls_ztable.

" possibly
CALL FUNCTION 'ZTABLE_UPDATE' IN UPDATE TASK
  EXPORTING
    is_ztable = ls_ztable.
scottcarricknwn
Participant
0 Kudos

Thanks Mateusz. Appreciate the help.

mateuszadamus
Active Contributor
0 Kudos

Did you solve your issue, scottcarricknwn ?

scottcarricknwn
Participant
0 Kudos

Unfortunately not yet but just getting going today. Hopefully have it solved soon and will update page for others to reference.

mateuszadamus
Active Contributor
0 Kudos

All fine. I've added some basic example code of what is going on in these functions on my end.

scottcarricknwn
Participant

Yeah it's working for me now. Appears on screen and updates custom field in EKKO upon changing.

For Function EXIT_SAPMM06E_006 (include ZXM06U36) i just needed this:

ekko_ci = i_ci_ekko. "grabs data from table and displays in cusotm field on customer data tab

For Function EXIT_SAPMM06E_008 (include ZXM06U37) i just needed this:

e_ci_ekko = ekko_ci. "takes updated data on custom field and updates ekko with it

Big thank you to you for the examples and help!!!!

Answers (1)

Answers (1)

former_member1716
Active Contributor
0 Kudos

scottcarricknwn,

A simple approach would be, try to check what are all the input parameters of these exits first, then think how you can use the inputs and reach out to the requirement.

I see both these exits belong to enhancement MM06E005, First check if there is any project already created for this enhancement using table MODACT, if yes use the same project else create a new one and incorporate the logic. You can use the transaction CMOD for creating the project.

Once you have implemented the required logic then you check the functionality. To suggest the code line we need to understand the business requirement here, kindly let us know what you are trying to achieve here?

Regards!