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: 

Add new ICON on ME22N

Former Member
0 Kudos

Hi All,

Anyone know how to add NEW ICON on the input screen at the following location:

/nME22N

-> select one Purchase Order for Services

-> select one Item Line

-> at "Services" tab on Item Details Level

-> Add new ICON behind "Serv. selection"

Please help!!

Thanks and Best Regards,

Neil

6 REPLIES 6

amit_khare
Active Contributor
0 Kudos

Implement BADI ME_GUI_PO_CUST.

Detailed documentation is in SE18.

Regards,

Amit

0 Kudos

Hi Amit,

Thanks for your information!

Can you tell me how can you find "ME_GUI_PO_CUST"?

Besides, documentation in SE18 are not enough for me. Are there any other document or sample program?

Thank you so much!

Neil

0 Kudos

Its hard to say about sample program as that means this BADI is active.

So if someone who has wrote a program for it can tell you more.

You have to go with the documentation only, or any functional consultant can tell you about this, as enhancements are basically initiated by them only.

Regards,

Amit

Former Member
0 Kudos

Hi all,

I want to make it clear:

New Icon = New Button

BR,

Neil

ferry_lianto
Active Contributor
0 Kudos

Hi,

Please check this sample program to find BADI and enhancement for a given transaction code. You just need to create a custom program in your system by cut and paste below codes.


REPORT ZTEST.

TABLES: TSTC,
TADIR,
MODSAPT,
MODACT,
TRDIR,
TFDIR,
ENLFDIR,
SXS_ATTRT ,
TSTCT.

DATA: JTAB LIKE TADIR OCCURS 0 WITH HEADER LINE.
DATA: FIELD1(30).
DATA: V_DEVCLASS LIKE TADIR-DEVCLASS.

PARAMETERS: P_TCODE LIKE TSTC-TCODE,
P_PGMNA LIKE TSTC-PGMNA .

DATA: WA_TADIR TYPE TADIR.


START-OF-SELECTION.

IF NOT P_TCODE IS INITIAL.
SELECT SINGLE * FROM TSTC WHERE TCODE EQ P_TCODE.
ELSEIF NOT P_PGMNA IS INITIAL.
TSTC-PGMNA = P_PGMNA.
ENDIF.

IF SY-SUBRC EQ 0.
SELECT SINGLE * FROM TADIR
WHERE PGMID = 'R3TR'
AND OBJECT = 'PROG'
AND OBJ_NAME = TSTC-PGMNA.

MOVE : TADIR-DEVCLASS TO V_DEVCLASS.

IF SY-SUBRC NE 0.
SELECT SINGLE * FROM TRDIR
WHERE NAME = TSTC-PGMNA.

IF TRDIR-SUBC EQ 'F'.
SELECT SINGLE * FROM TFDIR
WHERE PNAME = TSTC-PGMNA.

SELECT SINGLE * FROM ENLFDIR
WHERE FUNCNAME = TFDIR-FUNCNAME.

SELECT SINGLE * FROM TADIR
WHERE PGMID = 'R3TR'
AND OBJECT = 'FUGR'
AND OBJ_NAME EQ ENLFDIR-AREA.

MOVE : TADIR-DEVCLASS TO V_DEVCLASS.
ENDIF.
ENDIF.

SELECT * FROM TADIR INTO TABLE JTAB
WHERE PGMID = 'R3TR'
AND OBJECT in ('SMOD', 'SXSD')
AND DEVCLASS = V_DEVCLASS.

SELECT SINGLE * FROM TSTCT
WHERE SPRSL EQ SY-LANGU
AND TCODE EQ P_TCODE.

FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
WRITE:/(19) 'Transaction Code - ',
20(20) P_TCODE,
45(50) TSTCT-TTEXT.
SKIP.
IF NOT JTAB[] IS INITIAL.
WRITE:/(105) SY-ULINE.
FORMAT COLOR COL_HEADING INTENSIFIED ON.

* Sorting the internal Table
sort jtab by OBJECT.
data : wf_txt(60) type c,
wf_smod type i ,
wf_badi type i ,
wf_object2(30) type C.
clear : wf_smod, wf_badi , wf_object2.
* Get the total SMOD.

LOOP AT JTAB into wa_tadir.
at first.
FORMAT COLOR COL_HEADING INTENSIFIED ON.

WRITE:/1 SY-VLINE,
2 'Enhancement/ Business Add-in',
41 SY-VLINE ,
42 'Description',
105 SY-VLINE.
WRITE:/(105) SY-ULINE.
endat.
clear wf_txt.
at new object.
if wa_tadir-object = 'SMOD'.
wf_object2 = 'Enhancement' .
elseif wa_tadir-object = 'SXSD'.
wf_object2 = ' Business Add-in'.

endif.
FORMAT COLOR COL_GROUP INTENSIFIED ON.

WRITE:/1 SY-VLINE,

2 wf_object2,
105 SY-VLINE.
endat.

case wa_tadir-object.
when 'SMOD'.
wf_smod = wf_smod + 1.
SELECT SINGLE MODTEXT into wf_txt
FROM MODSAPT
WHERE SPRSL = SY-LANGU
AND NAME = wa_tadir-OBJ_NAME.
FORMAT COLOR COL_NORMAL INTENSIFIED OFF.

when 'SXSD'.
* For BADis
wf_badi = wf_badi + 1 .
select single TEXT into wf_txt
from SXS_ATTRT
where sprsl = sy-langu
and EXIT_NAME = wa_tadir-OBJ_NAME.
FORMAT COLOR COL_NORMAL INTENSIFIED ON.

endcase.

WRITE:/1 SY-VLINE,
2 wa_tadir-OBJ_NAME hotspot on,
41 SY-VLINE ,
42 wf_txt,
105 SY-VLINE.
AT END OF object.
write : /(105) sy-ULINE.
ENDAT.

ENDLOOP.

WRITE:/(105) SY-ULINE.

SKIP.
FORMAT COLOR COL_TOTAL INTENSIFIED ON.
WRITE:/ 'No.of Exits:' , wf_smod.
WRITE:/ 'No.of BADis:' , wf_badi.

ELSE.
FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
WRITE:/(105) 'No userexits or BADis exist'.
ENDIF.
ELSE.
FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
WRITE:/(105) 'Transaction does not exist'.
ENDIF.

AT LINE-SELECTION.

data : wf_object type tadir-object.
clear wf_object.

GET CURSOR FIELD FIELD1.
CHECK FIELD1(8) EQ 'WA_TADIR'.
read table jtab with key obj_name = sy-lisel+1(20).
move jtab-object to wf_object.

case wf_object.
when 'SMOD'.
SET PARAMETER ID 'MON' FIELD SY-LISEL+1(10).

CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
when 'SXSD'.
SET PARAMETER ID 'EXN' FIELD SY-LISEL+1(20).
CALL TRANSACTION 'SE18' AND SKIP FIRST SCREEN.
ENDCASE.

To learn a BADI the best place are:

http://help.sap.com/saphelp_nw04/helpdata/en/c8/19756543b111d1896f0000e8322d00/frameset.htm

http://help.sap.com/saphelp_nw04/helpdata/en/9d/12233a0edd7978e10000000a11402f/frameset.htm

/people/sergey.korolev/blog/2005/03/14/the-time-for-me-to-have-a-badi-of-my-own

BADI comprises of 2 parts:

First is definition which you do in SE18.

Then comes the implemantion where you will write your custom code in SE19.

Try to go through the link, you will get enough info to proceed .

Also check this example ...

First you need to implement the 2 BADIs in SE19.

The BADI ME_GUI_PO_CUST is responsible for Screen display and data exchange b/n db and the screen.

The second BADI ME_PROCESS_PO_CUST is responsible for PO upadate.

To get the screen in the Transaction you need to code in the method SUBSCRIBE of the first BADI.

Example:

ls_subscriber-name = subscreen4.

ls_subscriber-dynpro = 0700.

ls_subscriber-program = prog_name.

ls_subscriber-struct_name = structure.

ls_subscriber-label = TEST.

ls_subscriber-position = 4.

  • ls_subscriber-height = 6.

ls_subscriber-height = 8.

append ls_subscriber to re_subscribers.

clear ls_subscriber.

Regards,

Ferry Lianto

Former Member
0 Kudos

Dear All,

I used the "Other source" button instead.

Finally, I make it by activate user exit - "EXIT_SAPLMLSP_010" by t-code "CMOD".

After that, put "RAISE SELECTION_POSSIBLE" in inculde program "ZXMLUU05".

Thanks for all of you!!

BR,

Neil