We have added search box. Key in SAP issue keyword to search
TopBottom

Announcement: wanna exchange links? contact me at sapchatroom@gmail.com.

RE:[sap-abap] Problem with customised subscreen in ME21N using BadI

Posted by Admin at
Share this post:
Ma.gnolia DiggIt! Del.icio.us Yahoo Furl Technorati Reddit

Posted by helpful
on Aug 25 at 11:35 AM
Use this code


DATA: l_persistent TYPE mmpur_bool.

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

l_changeable TYPE mmpur_bool.
* Is PO changeable?
l_changeable = im_header->is_changeable( ).

LOOP AT ch_fieldselection ASSIGNING <fs>.
IF l_changeable IS INITIAL.
<fs>-fieldstatus = '*'. " Display
ELSE.
<fs>-fieldstatus = '+'. " Change
ENDIF.
ENDLOOP.

Hope it will help.

---------------Original Message---------------
From: bainab
Sent: Friday, March 18, 2011 11:56 AM
Subject: Problem with customised subscreen in ME21N using BadI

I am using BadI ME_GUI_PO_CUST & ME_PROCESS_PO_CUST to add a customized subscreen in the header. But the subscreen is only visible with ME23N & ME22N not with ME21N . I am new to BadI, so help is needed.
I have used the following code:
In BadI ME_GUI_PO_CUST with interface IF_EX_ME_GUI_PO_CUST~SUBSCRIBE the code I've written .. the following code ..
.

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 = 'HEADER'.

* 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 = '0002'.
* the program where the dynpro can be found
* "Created in a module pool program in SE80 to hold the subscreen in
*the tcode me21n, me22n, me23n*
ls_subscriber-program = 'ZME_GUI_PO_CUST_SCREEN'.
* each subscreen needs his own DDIC-Structure
ls_subscriber-struct_name = 'CI_EKKODB'.
* 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 support 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 IF_EX_ME_GUI_PO_CUST~MAP_DYNPRO_FIELDS i ve changed the follwoing .......
type-pools : MMMFD.
FIELD-SYMBOLS:
<mapping>
LIKE LINE OF ch_mapping.

LOOP AT ch_mapping ASSIGNING
<mapping>
.

CASE
<mapping>
-fieldname.
WHEN 'ZZPAYMENT'.
<mapping>
-metafield = mmmfd_cust_03.
ENDCASE.

ENDLOOP.

In the badi ME_PROCESS_PO_CUST, their is a method called FIELDSELECTION_HEADER
method IF_EX_ME_PROCESS_PO_CUST~FIELDSELECTION_HEADER .
DATA: l_persistent TYPE mmpur_bool.

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

* if the item is already on the database, we disallow to change field
* badi_bsgru
l_persistent = im_item->is_persistent( ).

IF l_persistent EQ mmpur_yes.
READ TABLE ch_fieldselection ASSIGNING <fs> WITH TABLE KEY metafield = mmmfd_cust_03.
IF sy-subrc IS INITIAL.
* <fs>-fieldstatus = '*'. " Display <-- this one was as per the sample code given.
<fs>-fieldstatus = '+'. " Input <-- this i added to make the field mandatory.
ENDIF.
ENDIF.

I have figured out the issue but do not the idea to fix the issue. I have put a break-point in the badi ME_PROCESS_PO_CUST, having the method called FIELDSELECTION_HEADER & run the tcode ME21N. In the line l_persistent = im_item->is_persisten & IF l_persistent EQ mmpur_yes and found out that the value of mmpur_yes equal to 'X', l_persistent is blank.

__.____._
Copyright © 2011 Toolbox.com and message author.

Toolbox.com 4343 N. Scottsdale Road Suite 280, Scottsdale, AZ 85251
Mark as helpful
View this online
  
Popular White Papers

In the Spotlight
Have you explored the Toolbox.com Marketplace? Learn more and access a free course now.
_.____.__

0 comments:

Post a Comment

T r a n s l a t e to your language