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: 

create new tab in header using badi ME_GUI_PO_CUST for tcode ME21N

former_member536879
Active Contributor
0 Kudos
1,518

Dear all,

i have implemented method SUBSCRIBE in ME_GUI_PO_CUST to create new tab in ME21N,

but the tab is not coming

following is the code snips, please tell where is the error, or some setting needs to be done

method IF_EX_ME_GUI_PO_CUST~SUBSCRIBE.

DATA: ls_subscriber LIKE LINE OF re_subscribers.

if sy-tcode eq ' ME21N' OR SY-TCODE EQ 'ME22N' OR SY-TCODE EQ 'ME23N'.

CHECK im_application = 'PO'.

CHECK im_element = 'HEADER'.

  • CLEAR re_subscribers[].

ls_subscriber-name = 'Customer-Data'.

ls_subscriber-dynpro = '0101'.

ls_subscriber-program = 'SAPLMEGUI'.

ls_subscriber-struct_name = 'MEPO_SUBSCRIBERS'.

ls_subscriber-label = 'Customer Data'.

ls_subscriber-position = 10.

ls_subscriber-height = 7.

APPEND ls_subscriber TO re_subscribers.

ENDIF.

endmethod.

Regards

Sumodh

1 ACCEPTED SOLUTION

mvoros
Active Contributor
0 Kudos
436

Hi,

I do not have screen 0101 in SAPLMEGUI. Have you created this screen? I assume that you have not because it is in SAP standard program. I replied to your another post that you can check example of implementation in SE18. There is also an example of screen in function group MEPOBADIEX. Basically you need to create your own function group with all required screens and then subscribe your screens in BADI.

Cheers

7 REPLIES 7

mvoros
Active Contributor
0 Kudos
437

Hi,

I do not have screen 0101 in SAPLMEGUI. Have you created this screen? I assume that you have not because it is in SAP standard program. I replied to your another post that you can check example of implementation in SE18. There is also an example of screen in function group MEPOBADIEX. Basically you need to create your own function group with all required screens and then subscribe your screens in BADI.

Cheers

0 Kudos
436

Hello Martin,

In the Function Group XM06 i have the screen 0101. This screen is Created through Screen exit.

So i cant get the Control of this Screen at the Header Level . Its getting trigger during the check Time.

so that i go for this Process . attaching tht screen through BADI ME_GUI_PO_CUST.

While Debugging by changing the Prog name in the class cl_screen_mm_view to SAPLMEGUI then its showing the screen 0101.

In the BADI i implemented the code in SUBSCRIBE Method Only.

IF there is any Code i want to Implement in tht badi in any of the methods.

Thanks in advance.

With Cheers,

Sumodh.P

mvoros
Active Contributor
0 Kudos
436

Hi,

this BADI also requires to have implemented another BADI ME_PROCESS_PO_CUST. DO you have it? There is also OSS note 496083. At the end there is a solution of typical problem for this BADI. Have a look, it may help you.

Cheers

0 Kudos
436

Hello Martin,

I already Implemented the BADI ME_PROCESS_PO_CUST.Let me check the OSS Note.

Thanks Very Much,

Cheers,

Sumodh.P

former_member536879
Active Contributor
0 Kudos
436

Answered

0 Kudos
436

Hi...I hv similar requirement.

I need to show a custom field in the screen for the items.

I tried using the methods "SUBSCRIBE" and "MAP_DYNPRO_FIELDS" as explained in the sample code.

Below is my code. I have copied the sample code and changed it lil.

Method "SUBSCRIBE":

DATA: ls_subscriber LIKE LINE OF re_subscribers.

  • we want to add a customer subscreen on the item detail tab

CHECK im_application = 'PO'.

CHECK im_element = 'ITEM'.

  • each line in re_subscribers generates a subscreen. We add one subscreen in this example

CLEAR re_subscribers[].

  • the name is a unique identifier for the subscreen and defined in this class definition

ls_subscriber-name = subscreen1.

  • the dynpro number to use

ls_subscriber-dynpro = '9000'.

  • the program where the dynpro can be found

ls_subscriber-program = 'SAPLZMMPO1'.

  • each subscreen needs his own DDIC-Structure

ls_subscriber-struct_name = 'ZMM_PO_CUST_SCREEN'.

  • a label can be defined

ls_subscriber-label = text-t01.

  • the position within the tabstrib can be defined

ls_subscriber-position = 13.

  • the height of the screen can be defined here. Currently we suport two screen sizes:

  • value <= 7 a sevel line subscreen

  • value > 7 a 16 line subscreen

ls_subscriber-height = 7.

APPEND ls_subscriber TO re_subscribers.

method "MAP_DYNPRO_FIELDS":

FIELD-SYMBOLS: <mapping> LIKE LINE OF ch_mapping.

*- customer fields

CONSTANTS: mmmfd_cust_01 TYPE mmpur_metafield VALUE 90000000.

LOOP AT ch_mapping ASSIGNING <mapping>.

CASE <mapping>-fieldname.

WHEN 'CLMNO'. <mapping>-metafield = mmmfd_cust_01.

ENDCASE.

ENDLOOP.

I created a function group - "ZMMPO1" and created the subscreen 9000 in that. I placed the custom field in that screen. Tha main program of ZMMPO1 is "SAPLZMMPO1".

I created a structure also - "ZMM_PO_CUST_SCREEN".

I want to know whether this is sufficient to display the tab on the screen or am I missing something.

It is mentioned that the implementation of "ME_PROCESS_PO_CUST" is a pre-requisite.

could you lemme know the process please.

Thanks,

Ram.

Former Member
0 Kudos
436

Hi experts,

I have added a new tab in me21n,me22n and me23n using Badi( ME_GUI_PO_CUST and ME_PROCESS_PO_CUST ) at item level.

I have written the code in SUBSCRIBE , MAP_DYNPRO_FIELDS methods in 1st badi ). I want to save the data from the four fields from my tab while creating the po number. All my four fields are added to the structure CI_ekpodb. Please help me with the code.

Thanks,

Debrath.