09-23-2008 8:50 PM
Hi Guys,
I need to add a custom button on maintainance View. On click of that button i need to grab the selected row and do something. How can i achieve this ?
Thanks
Amandeep
09-23-2008 9:18 PM
Have a look on the modification event ST.
http://help.sap.com/saphelp_nw2004s/helpdata/en/91/ca9fada9d111d1a5690000e82deaaa/frameset.htm
Regards,
Naimesh Patel
09-23-2008 9:18 PM
Have a look on the modification event ST.
http://help.sap.com/saphelp_nw2004s/helpdata/en/91/ca9fada9d111d1a5690000e82deaaa/frameset.htm
Regards,
Naimesh Patel
09-23-2008 10:15 PM
Questions.
1. In Realization Phase the doc says "The function group interface must be a copy of the standard interface SAPLSVIM, which can then be modified.". I was assuming when you generate the maintainince view the code is generated by the system, so what is this copy about ?
2. Do i have to create my own GUI stats and do event handling on top of that for all functions like Mark All, Delete, Insert etc etc ?
Amandeep
09-24-2008 1:09 AM
1. It says that you need to copy the standard interface into your Function Group (Group which contains the Table maintainence)
If you open your group in se80, you will not able to find the GUI status. Because system doesn't contain the PF stautus. It refers to the PF status of the program SAPLSVIM. So, Copy all the PF Status into your Function Group.
2. After copying you need to add your buttons in the respective PF-status. You can create your own PAI module and handle the PF status button.
Regards,
Naimesh Patel
09-24-2008 2:23 AM
09-24-2008 2:50 AM
I thought, Step-by-step explaination would be useful.
Follow this link: [Add Custom Button on Maintaince View (SM30)|http://help-abap.blogspot.com/2008/09/add-custom-button-on-maintianence-view.html]
Regards,
Naimesh Patel
09-24-2008 3:47 AM
Nice. But i am getting this error at the statement when total[ ] gets assigned to itab[ ].
The table total is a flat line. Its a long string where as itab has components.
Two internal tables are neither compatible nor convertible.
How can i assign the Extract itab to the my component field table ??
LOOP AT extract.
MODULE liste_init_workarea.
CHAIN.
FIELD ztst_incentive-pernr .
FIELD ztst_incentive-mgr_pernr .
FIELD ztst_incentive-plan_type .
All i need is this table to be assigned to my declared itab which will have all the info..
Thanks
-A
Edited by: Amandeep Bal on Sep 23, 2008 11:34 PM
09-24-2008 2:01 PM
I am on ECC 5.0 (non unicode) and it is allowing me to conver the TOTAL to ITAB.
May be you can try like
LOOP AT TOTAL INTO WA_ITAB.
APPEND WA_ITAB TO ITAB.
CLEAR WA_ITAB.
ENDLOOP.
I put my Custom PAI module at the Last in the Screen Flow. By the time control reaches here, I have data properly marked in the TOTAL table.
Regards,
Naimesh Patel
09-24-2008 2:20 PM
Hi Naimesh,
I am on ECC 5.0 as well. I have put my module as the last module when the complete screen processing is complete.
MODULE liste_update_liste.
ENDCHAIN.
ENDLOOP.
MODULE liste_after_loop.
MODULE pdf.
I still have that unicode problem.
Data objects in a Unicode program are not convertible.
Below is my codeod MODULE PDF.
MODULE pdf INPUT.
DATA: l_count TYPE i.
* Table of the same structure of the TOTAL which can be exported
DATA: BEGIN OF itab OCCURS 0.
INCLUDE STRUCTURE ztst_incentive.
INCLUDE STRUCTURE vimflagtab.
DATA: END OF itab.
DATA: wa LIKE LINE OF itab.
LOOP AT total INTO wa. "----->>>>>> Short Dump Occurs here
* APPEND wa TO itab.
CLEAR wa.
ENDLOOP.
ENDMODULE. " PDF INPUT
SHORT DUMP
Error analysis
The statement
"MOVE src TO dst"
requires the operands "dst" and "src" to be comvertible.
Since this statement occurs in a Unicode program, the special
convertibility rules for Unicode programs apply. In this case, the
following rules have been broken:
Amandeep
09-24-2008 2:26 PM
Check this help:
http://help.sap.com/saphelp_nw2004s/helpdata/en/33/96613cb44b6c4de10000000a11405a/frameset.htm
Regards,
Naimesh Patel
09-24-2008 2:57 PM
Is there any simple way to check the user doesn't select more than one row when he click on my custom function Code? I am finding it bit complicated.
In the Doc all what has bee discussed is that how they have changed the code from Non-unicode to Unicode. How do i deal with tables and marked lines ?
Thanks
A
09-24-2008 3:31 PM
Try something like this:
FIELD-SYMBOLS: <fs> TYPE ANY,
<f_field> TYPE ANY.
DATA: l_cnt TYPE i.
LOOP AT total ASSIGNING <fs>.
ASSIGN COMPONENT 'MARK' OF STRUCTURE <fs> TO <f_field>.
IF sy-subrc = 0.
l_cnt = l_cnt + 1.
IF l_cnt = 2.
EXIT.
ENDIF.
ENDIF.
ENDLOOP.
IF l_cnt = 2.
* don't process
ELSE.
* process
ENDIF.
Regards,
Naimesh Patel
09-24-2008 4:00 PM
Hi Naimesh,
Unfortunately there will be no Component 'MARK' in <fs>. Itab is doing a flat assignnent to the FS and is not respecting the Components at all.
Is it s good idea to implement something like this.
ENDCHAIN.
FIELD vim_marked MODULE liste_mark_checkbox.
MODULE capture_marks.
CHAIN.
this is the primitive way Non Unicode :(.
MODULE capture_marks INPUT.
itab-pernr = total+3(8).
itab-mgr_pernr = total+11(8) .
itab-plan_type = total+19(15) .
itab-grp = total+34(40).
itab-vc_pout_prd = total+74(10).
itab-kostl = total+84(10).
itab-mgr_begda = total+94(8).
itab-ee_begda = total+102(8).
itab-endda = total+110(8).
itab-mark = vim_marked.
APPEND itab.
ENDMODULE. " CAPTURE_MARKS INPUT
Don;t seem to have a choice here i guess.
Any further recommendations ?
Amandeep
09-24-2008 4:06 PM
I think so....
I don't have the Unicode check otherwise I would have told you the proper way to get it there.
Regards,
Naimesh Patel
09-24-2008 4:14 PM
Can you try like this in the PAI module to handle the custom button:
FIELD-SYMBOLS: <fs> TYPE ANY,
<f_line> TYPE ANY.
TYPES: BEGIN OF TY_EVENTS.
INCLUDE TYPE ZTEST_NP_EVENT.
INCLUDE STRUCTURE VIMFLAGTAB.
types: END OF TY_EVENTS.
DATA: LA_EVENTS TYPE TY_EVENTS.
LOOP AT TOTAL assigning <fs>.
ASSIGN COMPONENT 'LINE' OF STRUCTURE <fs> TO <f_line>.
la_events = <f_line>.
ENDLOOP.
Regards,
Naimesh Patel
09-24-2008 4:41 PM
Same Problem
Runtime Errors UC_OBJECTS_NOT_CONVERTIBLE
Error analysis
The statement
"MOVE src TO dst"
requires the operands "dst" and "src" to be comvertible.
Since this statement occurs in a Unicode program, the special
convertibility rules for Unicode programs apply. In this case, the
following rules have been broken:
Amandeep
07-02-2009 8:11 AM
Hi Naimesh,
I found your post really helpful. I am trying to create a Custom Button on my SM30 transaction which just calls the Next screen in the tool which I have created
However I do not seem to have necessary authorizations to create an Event ST in Table Maintenance Generator Screen. My Question is if somehow I maintain an entry here then will this Custom Button visible for any and every SM30 transaction or will it be displayed only when my View is Run ?
Also do we have Plab-B which can be executed if I still don't manage to find necessary authorizations for the same?
Thanks a lot once again for your valuable post..!!
Regards,
Nishan Desai
09-24-2008 4:38 AM
I am still having some issues with this. Not completely resolved though.
Amandeep