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

PO ENHANCEMENT

former_member605939
Participant
0 Kudos
4,269

Is it feasible to display the total gross weight of items involved in po in kgs at po header in a new field.

( suppose PO has 3 items with weight 10kgs,20kgs,30kgs. these arel availble line item wise in po. My business requirement is to display the total weight 60 kgs in new field.

Basically header level field addition is ok. But problem is that how to update line item wise total weight to header level field.How the control should pass ?

Screen shot attatched

15 REPLIES 15
Read only

Dominik_Tylczynski
SAP Champion
SAP Champion
0 Kudos
3,739

Hello abaplearner

You can enhance PO screens with your own tabs using ME_GUI_PO_CUST BADI.

Use SE18 transaction to examine the BADI documentation and the sample code provided in class CL_EXM_IM_ME_GUI_PO_CUST.

Best regards

Dominik Tylczynski

Read only

Abinathsiva
Active Contributor
0 Kudos
3,739

Hi,

Implement Badi ME_PROCESS_PO_CUST write a custom code in method CHECK or POST - by reading ekpo - weight and sum the same...

Read only

RaymondGiuseppi
Active Contributor
0 Kudos
3,739

Suggested steps:

  • Create a custom function group, in this function group create a subscreen with your fields
  • Implement BAdI ME_GUI_PO_CUST to declare your screen, attach it to header and copy data between transaction and your function group using some FMs.
  • Implement BAdI ME_PROCESS_PO_CUST to optimize calculation of the fields. In your case initialize the weight in method OPEN, and maintain it in method PROCESS_ITEM for new and changed items (look at methods im_item->get_data and get_previous_data) pass the weight to your function group using some FMs.
Read only

0 Kudos
3,739

For this requirement , added project in CMOD added foeld in ekko (CI_EKKODB)..

I want calculate total weight for line items in ekpo and put in header field that created in ekko using include.

Now which exit to write .

EXIT_SAPMM06E_006 EXIT_SAPMM06E_007 EXIT_SAPMM06E_008 EXIT_SAPMM06E_009 EXIT_SAPMM06E_012 EXIT_SAPMM06E_013 EXIT_SAPMM06E_014 EXIT_SAPMM06E_016 EXIT_SAPMM06E_017 EXIT_SAPMM06E_018

to get this

Read only

0 Kudos
3,739

You could try with EXIT_SAPMM06E_014, EXIT_SAPMM06E_006, EXIT_SAPMM06E_016 and EXIT_SAPMM06E_017, but IMHO would be easier in the BAdI.

Read only

0 Kudos
3,739

As you suggested that IMHO would be easier in the BAdI. Can you elaborate about this . I want to do with BADI.

add screen in ME_GUI_PO_CUST

How to get calculate the total weight for all line items and the populate in header ?

Read only

0 Kudos
3,739

Working the enhancement to get po gross weight and stlll facing the issue to calculate the item level weight data at header level.

Read only

0 Kudos
3,739

Did you use my suggestion with method OPEN (to initialize the field value with a loop on items) and maintain it in PROCESS_ITEM (using previous and current value from item processed)

Else post or describe your code.

Read only

0 Kudos
3,739

raymond.giuseppi

I want to implement badi for this, but not confident how to create the screen field using BADI ?

for creating screen field , we need to use the exit. or any other way to create screen.

Thanks

Read only

0 Kudos
3,739

Create the screen (sub screen) in any program, easiest is use a custom function group to define your screens and handle communication with the BAdI. You register the screen, program and dynpro, in a dedicated method of the BAdI.

Read only

0 Kudos
3,739

Hi ,

I want to populate the po total weight (line item wise sum in the Weight field) . As explained by raymond.giuseppi , 3a9e4ce873a94034b33dc62b0ce600ee,

S Abinath .I followed the said steps.

With the help of the Badi CL_EXM_IM_ME_PROCESS_PO_CUST able to create the po header screen fields .

I implemented the following Badi methods

And able to get the fields. Also implemented the BADI ZZME_PROCESS_PO_CUST.

But the data is not getting populated in the above fields and also in the PO header data base table EKKO

.

Please let me know where I am missing the step.

Read only

0 Kudos
3,739

abaplearner

If you get the custom fields in the additional PO tab, then I think the problem must be with the BAdI implementation. I can't help you more as you have not shared the code

Read only

0 Kudos
3,739

Can any one correct me on this process to achieve my requirement.

is the METHOD IF_EX_ME_GUI_PO_CUST~EXECUTE should also be implemented ?. What will be the parameters for header case in EXECUTE method. And how to pass or align the calculated line item weight from lines to field using function module (or function group ) to update ekko structure.

Thanks

Read only

0 Kudos
3,739
  1. As already written, in the ME_PROCESS_PO_CUST implementation handle the total calculation (initialize at method open, uodate it at method item_process when data changed) Save the result in some attributes of the instance, also pass it to the function group with a dedicated FM so you will be able to display it in the header subscreen.
  2. The Execute method has to be implemented if you create some customer function code, in this method the im_model will refer to header or item occurence (look at the sample provided by SAP, use macro mmpur_dynamic_cast)
Read only

former_member605939
Participant
0 Kudos
3,739

The problem with this is that i need to calculate the line item wise grand sum of weights then update the grand total of weights in po header with new field ?