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

badi implementation

Former Member
0 Likes
884

Hi Expets,

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.

8 REPLIES 8
Read only

madhu_vadlamani
Active Contributor
0 Likes
842

Hi Debrath,

Welcome to scn. Did you check the available threads and wiki on this topic.There are no of threads available threads on this. Please check with that and post if there is any issue. If moderators consider this as a basic question they may lock.

Regards,

Madhu.

Read only

Former Member
0 Likes
842

Hi Madhu,

Thanks for your help. I did check for related threads. So I guess I better post my question in some of the related threads.

Thanks,

Debrath.

Read only

0 Likes
842

Hi Debrath,

Check this thread there is a good discussion about adding a custom tab at item level.

[Custom Tab at item level|;

Regards,

Madhu.

Read only

0 Likes
842

Hi Madhu,

As per the link that you have suggested me. The discussion did help me up to a certain level. But my major problem was regarding the save in me21n. I did post my query there too.

Anyways thanks for your help.

Regards,

Debrath.

Read only

0 Likes
842

Hi Debrath,

Please post the code you kept and where you struck in that.

Regards,

Madhu.

Read only

0 Likes
842

Hi Madhu,

I have implemented the badi 'ME_PROCESS_PO_CUST' and added code in method 'FIELDSELECTION_ITEM'

Code:

DATA: l_persistent TYPE mmpur_bool.

type-pools : mmmfd.

FIELD-SYMBOLS: <fs> LIKE LINE OF ch_fieldselection.

READ TABLE ch_fieldselection ASSIGNING <fs> WITH TABLE KEY metafield = mmmfd_cust_08.

IF sy-subrc IS INITIAL.

<fs>-fieldstatus = '+'. " editable

ENDIF.

I have also implemented the badi 'ME_GUI_PO_CUST'.

In 'SUBSCRIBE' method...

DATA: ls_subscriber LIKE LINE OF re_subscribers.

*--FIRST SCREEN POPULATION

*--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 = '9003'.

*--the program where the dynpro can be found

ls_subscriber-program = 'SAPLZFN_BADI'.

*--each subscreen needs itsown DDIC-Structure

ls_subscriber-struct_name = 'CI_EKPODB'.

*--a label can be defined

ls_subscriber-label = text-001.

*--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.

In 'MAP_DYNPRO_FIELDS' method.

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

LOOP AT ch_mapping ASSIGNING <mapping>.

CASE <mapping>-fieldname.

WHEN 'COLOR'. <mapping>-metafield = mmmfd_cust_08. " Color

WHEN 'TEMPB'. <mapping>-metafield = mmmfd_cust_09. " Heating Temperature

WHEN 'MHDHB'. <mapping>-metafield = mmmfd_cust_10. " shelf life

WHEN 'GROES'. <mapping>-metafield = mmmfd_cust_07. "size

ENDCASE.

ENDLOOP.

I have also created a function group zfn_badi, where i created the subscreen.

By doing this i have got the tab with the required fields in me21n me22n me23n.

But when i try to save the datas from my custom fields it is not saving.

If i put break-point in any of the methods in this two badi s ,no one is getting triggered when i click save in me21n, except post check and close. How should i proceed. I want to save my data from ITEM level.

Regards,

Debrath

Read only

0 Likes
842

Hi Debrath,

Please go through this wiki by kiran which is helpful.

[Custom Tab At Item Level|http://wiki.sdn.sap.com/wiki/display/ABAP/DetailedexplanationaboutBADIandthewaystofindtheBADIwithanexample%28ME23n+transaction%29]

Regards,

Madhu.

Read only

0 Likes
842

Hi Madhu,

I had refered this link only to write my code. This only works for displaying data in me23n. But the tab doesnt appear in me21n or me22n(in editable mode). So i implemented the "process" badi, through which i got the tab in me21n. But after that the main issue comes into picture i.e saving the data s from the fields of the custom tab.

Thanks and Regards,

Debrath.

Edited by: debrath1212 on Nov 9, 2011 9:45 AM

Hi Madhu,

I am able to save the values. I have created a different structure and used my PBO to save the values. Now it is working fine.

Thanks for your help.

Thanks and Regards,

Debrath.