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: 

Implementing badi ME_GUI_PO_CUST

former_member201364
Participant
0 Kudos

Hi,

I created implementation for the badi ME_GUI_PO_CUST.

In the method IF_EX_ME_GUI_PO_CUST~SUBSCRIBE

I've written the below code

***

DATA: ls_subscriber LIKE LINE OF re_subscribers.

CHECK im_application = 'PO'.

CHECK im_element = 'HEADER'.

CLEAR re_subscribers[].

ls_subscriber-name = subscreen1.

ls_subscriber-dynpro = '9000'.

ls_subscriber-program = 'SAPMZTEST'.

ls_subscriber-struct_name = 'MEPO_BADI_STRUCT'.

ls_subscriber-label = 'New'.

ls_subscriber-position = 5.

ls_subscriber-height = 7.

APPEND ls_subscriber TO re_subscribers.

****

I've created one module pool program SAPMZTEST and a sub screen 9000 for that program .

If it is not the correct procedure pls guide me.

I could not see a new tab in PO header. Could anyone pls let me know what should I do to get a new tab?

Thanks,

Poornima

8 REPLIES 8

former_member181995
Active Contributor
0 Kudos

I can see you only implement SUBSCRIBE but in order to activate the scren you may need some more implemention of methods.

MAP_DYNPRO_FIELDS    
TRANSPORT_FROM_MODEL 
TRANSPORT_TO_DYNP    
TRANSPORT_FROM_DYNP  
TRANSPORT_TO_MODEL   
EXECUTE

Read documentation of ME_GUI_PO_CUST please read docu..of all methods also you will get enough idea.

Amit.

former_member188685
Active Contributor
0 Kudos

Did you check the sample implemenation class CL_EXM_IM_ME_GUI_PO_CUST

and also may be that is created and it is hidden in other tabs.

ls_subscriber-position = 5. just check in the postion 5.

0 Kudos

But At any cost she/he must need to implement IF_EX_ME_GUI_PO_CUST~MAP_DYNPRO_FIELDS

IF_EX_ME_GUI_PO_CUST~TRANSPORT_FROM_MODEL

IF_EX_ME_GUI_PO_CUST~TRANSPORT_TO_DYNP

IF_EX_ME_GUI_PO_CUST~TRANSPORT_FROM_DYNP

IF_EX_ME_GUI_PO_CUST~TRANSPORT_TO_MODEL

IF_EX_ME_GUI_PO_CUST~EXECUTE too from BADi

Otherwise screen navigation in Me21n with all tabs may be out of track.

Again Correct me if i'm wrong

Cheers,

Amit.

0 Kudos

Sorry Amit, you are correct.

along with subscribe and MAP_DYNPRO_FIELDS is enough to see the screen. But for comple functionality all the methods required anyway.

0 Kudos

Okay

Thats why i suggest he/she to implement all methods in my first post.because with only one method custom screen would be created and even activate but would not be reflect in ME21n.

Anyways need not to sorry big bro.

You still a Great

Cheers,

Amit

0 Kudos

Hi,

I have added tab in the header of the purchase oder and it is displaying in me21n, me22n and me23n.

this tab contains three fields buyer name,buyer id,buyer phone no, this fields are appended in the ci_ekkodb structure of ekko.

now the data is not saving in the database.

i have created a table ci_ekkodb in function group zmepobadix in top include and created two function modules

zdata_push and zdat_pop

the code what i had return in methods of me_gui_po_cust is

transport_from_model:----


DATA: l_item TYPE REF TO if_purchase_order_item_mm,

ls_header type ref to if_purchase_order_mm,

ls_mepoheader type mepoheader,

ls_mepoitem TYPE mepoitem,

ls_customer TYPE CI_EKKODB,

DYNP_DATA_PBO type CI_EKKODB.

case im_name.

when subscreen1.

mmpur_dynamic_cast ls_header im_model.

check not ls_header is INITIAL.

ls_mepoheader = ls_header->get_data( ).

MOVE-CORRESPONDING ls_mepoheader TO dynp_data_pbo.

WHEN OTHERS.

ENDCASE.

transport_to_dynp----


DATA : DYNP_DATA_PBO TYPE CI_EKKODB.

CASE im_name.

WHEN subscreen1.

  • CALL FUNCTION 'ZMEPOBADIEX_PUSH'

  • EXPORTING

  • im_dynp_data = dynp_data_pbo.

CALL FUNCTION 'ZDATA_PUSH'

EXPORTING

im_dynp_data = dynp_data_pbo.

WHEN OTHERS.

ENDCASE.

transport_from_dynp----


CONSTANTS :mmpur_yes TYPE c VALUE 'X'.

DATA : DYNP_DATA_PAI TYPE CI_EKKODB,

DYNP_DATA_PBO TYPE CI_EKKODB.

CASE im_name.

WHEN subscreen1.

CALL FUNCTION 'ZDATA_POP'

IMPORTING

EX_DYNP_DATA = dynp_data_pai.

IF dynp_data_pai NE dynp_data_pbo.

  • something has changed therefor we have to notify the framework

  • to transport data to the model

re_changed = mmpur_yes.

ENDIF.

WHEN OTHERS.

ENDCASE.

transport_to_model----


DATA: l_item TYPE REF TO if_purchase_order_item_mm,

ls_header type REF TO if_purchase_order_mm,

ls_mepoheader type mepoheader,

ls_mepoitem TYPE mepoitem,

ls_customer TYPE CI_EKKODB,

dynp_data_pai TYPE CI_EKKODB,

dynp_data_pbo TYPE CI_EKKODB.

CASE im_name.

WHEN subscreen1.

mmpur_dynamic_cast ls_header im_model.

check not ls_header is INITIAL.

ls_mepoheader = ls_header->get_data( ).

IF dynp_data_pbo-zzbuyer NE dynp_data_pai-zzbuyer OR

ls_mepoheader-zzbuyer = dynp_data_pai-zzbuyer.

ls_header->set_data( ls_mepoheader ).

endif .

IF dynp_data_pbo-zzmail NE dynp_data_pai-zzmail OR

ls_mepoheader-zzmail = dynp_data_pai-zzmail.

ls_header->set_data( ls_mepoheader ).

endif.

IF dynp_data_pbo-zzphone NE dynp_data_pai-zzphone OR

ls_mepoheader-zzphone = dynp_data_pai-zzphone.

ls_header->set_data( ls_mepoheader ).

endif.

IF dynp_data_pbo-zzextno NE dynp_data_pai-zzextno OR

ls_mepoheader-zzextno = dynp_data_pai-zzextno.

ls_header->set_data( ls_mepoheader ).

ENDIF.

WHEN OTHERS.

ENDCASE.

I'm not undustanding y the data is not saving in the database.

Please help.

Thanks in advance.

Regards,

Archana.

0 Kudos

Hi All,

I have understood the complete coding part, but the only thing I am unable to understand is "Subscreen1" which is given as the name in Subscriber method and used in the "CASE" structure of all other methods. I request anybody to tell me about that "Subscreen1" where you have declared and where you are using it.

Thanks & Regards

Harish

0 Kudos

Thank you, got the solution. It is a constant declared in the class attributes. The constant value has to be 'ITEM' or 'HEADER' as per you requirement.

Thank you