How to create function code for field in GRID like list box in screen
Hi all,
I have requirement like drop down is created for field1 in GRID,
and have given f4 help for it, as soon as i change the data in the field
event has to trigger to update thevalues in other field.
This scenario i worked on screens where field is created with listbox and assign function code to it
when the field value changes the event triggers .
Is there is anything like that which will fire the event for field value changes.
can i update anything through the fieldcatalogue.
anybody help me on this
Regards,
Madhavi
Hi Madhavi,
yes we can do that by registering edit events..
check the below example.. has both the variants dropdown/f4 hlp...
screen flow logic
PROCESS BEFORE OUTPUT.
MODULE pbo.
PROCESS AFTER INPUT.
MODULE pai AT EXIT-COMMAND.
program
* CLASS lcl_event_responder DEFINITION *
CLASS lcl_event_responder DEFINITION.
PUBLIC SECTION.
DATA : ls_changed_cell TYPE lvc_s_modi,
lv_language TYPE spras..
METHODS refresh_changed_data FOR EVENT data_changed
OF cl_gui_alv_grid
IMPORTING er_data_changed
e_ucomm.
ENDCLASS. "event_responder DEFINITION
DATA: go_handler TYPE REF TO lcl_event_responder,
go_container TYPE REF TO cl_gui_custom_container,
go_grid TYPE REF TO cl_gui_alv_grid,
gt_fieldcat TYPE lvc_t_fcat,
gv_language TYPE spras VALUE 'E',
gt_outtab TYPE TABLE OF makt WITH HEADER LINE.
PARAMETERS : dropdown TYPE char01 RADIOBUTTON GROUP grp,
f4help TYPE char01 RADIOBUTTON GROUP grp.
START-OF-SELECTION.
CALL SCREEN 100.
END-OF-SELECTION.
* MODULE PBO OUTPUT *
MODULE pbo OUTPUT.
SET PF-STATUS 'BASIC'.
PERFORM create_and_init_alv CHANGING gt_outtab[]
gt_fieldcat.
ENDMODULE. "pbo OUTPUT
* MODULE PAI INPUT *
MODULE pai INPUT.
SET SCREEN 0. LEAVE SCREEN.
ENDMODULE. "pai INPUT
FORM create_and_init_alv CHANGING pt_outtab LIKE gt_outtab[]
pt_fieldcat TYPE lvc_t_fcat.
CHECK go_container IS NOT BOUND.
CREATE OBJECT go_container
EXPORTING
container_name = 'CUSTOM'.
CREATE OBJECT go_grid
EXPORTING
i_parent = go_container.
PERFORM build_display_table.
PERFORM build_fieldcat CHANGING pt_fieldcat.
IF dropdown EQ abap_true.
PERFORM set_drdn_table.
ENDIF.
go_grid->set_table_for_first_display( CHANGING it_fieldcatalog = pt_fieldcat
it_outtab = pt_outtab ).
go_grid->set_ready_for_input( 1 ).
" raises the 'data_changed' event when we select another cell/any action after changing the data
go_grid->register_edit_event( EXPORTING i_event_id = cl_gui_alv_grid=>mc_evt_modified ).
CREATE OBJECT go_handler.
SET HANDLER go_handler->refresh_changed_data FOR go_grid.
ENDFORM. "CREATE_AND_INIT_ALV
FORM build_display_table.
FREE gt_outtab.
SELECT * FROM makt UP TO 20 ROWS INTO TABLE gt_outtab WHERE spras EQ gv_language.
ENDFORM. "build_display_table
FORM build_fieldcat CHANGING pt_fieldcat TYPE lvc_t_fcat.
DATA ls_fcat TYPE lvc_s_fcat.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'MAKT'
CHANGING
ct_fieldcat = pt_fieldcat.
LOOP AT pt_fieldcat INTO ls_fcat.
IF ls_fcat-fieldname EQ 'SPRAS'.
ls_fcat-edit = abap_true..
ls_fcat-outputlen = 8.
IF dropdown EQ abap_true.
ls_fcat-drdn_hndl = '1'.
ls_fcat-checktable = '!'. "do not check foreign keys
ENDIF.
MODIFY pt_fieldcat FROM ls_fcat.
ENDIF.
ENDLOOP.
ENDFORM. "build_fieldcat
FORM set_drdn_table.
CHECK go_grid->offline( ) IS INITIAL.
DATA: lt_dropdown TYPE lvc_t_drop,
ls_dropdown TYPE lvc_s_drop.
ls_dropdown-handle = '1'.
ls_dropdown-value = 'EN'.
APPEND ls_dropdown TO lt_dropdown.
ls_dropdown-handle = '1'.
ls_dropdown-value = 'DE'.
APPEND ls_dropdown TO lt_dropdown.
CALL METHOD go_grid->set_drop_down_table
EXPORTING
it_drop_down = lt_dropdown.
ENDFORM. " set_drdn_table
FORM change_display_table USING pv_language pv_rowno TYPE i.
READ TABLE gt_outtab INDEX pv_rowno.
SELECT SINGLE * FROM makt INTO gt_outtab WHERE matnr = gt_outtab-matnr AND spras = pv_language.
IF sy-subrc EQ 0.
DELETE gt_outtab INDEX pv_rowno.
INSERT gt_outtab INDEX pv_rowno.
ELSE.
CLEAR : gt_outtab-maktx,
gt_outtab-maktg.
DELETE gt_outtab INDEX pv_rowno.
INSERT gt_outtab INDEX pv_rowno.
ENDIF.
ENDFORM. "change_display_table
* CLASS event_responder IMPLEMENTATION *
CLASS lcl_event_responder IMPLEMENTATION.
METHOD refresh_changed_data.
READ TABLE er_data_changed->mt_mod_cells INTO ls_changed_cell INDEX 1.
CALL FUNCTION 'CONVERSION_EXIT_ISOLA_INPUT'
EXPORTING
input = ls_changed_cell-value
IMPORTING
output = lv_language.
PERFORM change_display_table USING lv_language ls_changed_cell-row_id.
go_grid->refresh_table_display( ).
ENDMETHOD. "click
ENDCLASS. "event_responder IMPLEMENTATION
Cheers,
Jose.
Similar Messages
-
How to find function code for buttons on toolbar in oops alv
Hi experts,
I want to remove some buttons from toolbar in oops alv, i know the procedure like get function code and pass the value in a table and pass that table to IT_TOOLBAR_EXCLUDING of
method set_table_for_first_display but I WANT TO KNOW HOW TO FIND FUNCTION CODE FOR BUTTONS ON TOOLBAR IN OOPS ALVHi Prakash,
-->First you have to set the pf status in your alv program by,
{FORM pf_status USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'FIRST'.
ENDFORM. "PF_STATUS}
-->Pass this Subroutine name in the Function module, Reuse_alv_grid_display's parameters i.e,
i_callback_pf_status_set = 'PF_STATUS'}
*-->Then doble click on that pf status,
From the menu bar, select Extras->Adjust Template->List Viewer,
This will give you the existing statndard gui status of the program*
->Then catch that function codes in the User command Parameter of the Function module Reuse.. i.e,
i_callback_user_command = 'COMM'
And make a subroutine of the name 'COMM'i.e,
FORM comm USING ucomm LIKE sy-ucomm selfield TYPE slis_selfield.
DATA: okcode TYPE sy-ucomm.
okcode = ucomm.
CASE okcode.
WHEN 'REF'.
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
titel = 'MANSI'
txt1 = 'CREATED BY'
txt2 = SY-UNAME
TXT3 = ' '
TXT4 = ' '
endcase.
Hope it helps you
Regrds
Mansi -
How to create transaction code for maintenance view
hai friends,
i hope every thing goes good.
i have doubt, how to create transaction code for maintenance view. I created view for tranperant table and now i want to create transaction code for the view.
i tried and i donot know the screen number and program name and where can i give the view name.
if any one know please post in details.
thanks in advance.Hi Elam,
You need to create a "Parameter Transaction".
What this means is that you will have a transaction (let's call it "ZMAINT") which calls "SM30" and passes in your table name.
Go to transaction SE93 and enter your new transaction code. Enter in the Tcode description and choose "Transaction with Parameters" (it shouldbe the last radio button).
Enter in the default transaction "SM30" and tick the "Skip Initial Screen" check box. Hit Enter.
Now scroll to the bottom of the screen and you will see a Table Control where you will need to enter in the values to the SM30 selection screen.
Because you hit ENTER, the program will have loaded in the Selection Screen parameters into it's memory. Hit the drop down for "Name of Screen Field" and select "VIEWNAME" and then enter in your Z Table in the "Value" column.
Now go to the next line and hit the drop down and select "UPDATE" in the "Name of Screen Field". Enter in a "X" in the value column.
Now save the transaction and there you have it.
Hope this helps.
Cheers,
Pat.
PS. Kindly assign Reward Points to the posts you find helpful. -
How to create transaction code for a Z-table
How to create transaction code for a Z-table?
Se93 --> then which radio button to be selected? and what is the program nam e to be givenHi Sam,
<b>Procedure to create a TCODE for ZTABLE:</b>
Create a table maintainance/View for the Z* Table.
Once you create the view goto SE93>Select Parameter transaction and give the short desc.>
Give the transaction as SM30(Skip the first screen-optional)>Check all check boxes under GUI support>In the default values(grid)section first row give the VIEWNAME as you created initially and the second row UPDATE as X.
<u><i>Se93 --> then which radio button to be selected</i></u>
Select the parameter transaction as a radio button.
<u><i>what is the program nam e to be given</i></u>
no need to give any program name. Instead you have to give the transaction code name as SM30.
Pls mark the helpful answers.
Thanks
Eswar -
How to create transactoin code for a predefined variant?
Hi, I have created one variant for a custom report.How to create transaction code for the report with that variant?
When you create the transaction in SE93 select the Program and selection screen(Report transaction) type not
the transaction with variant(Variant transaction) -
How to create plsql code for a snowflake cube
hi everybody!
do anyone know how to create plsql code for a snowflake tiype dimension to create
a cube?how to map the atributes, or if there are any exceptional atributes which I can use like in a temporal dimension?
thank you
waiting for any answerThe DBMS_AWM package provides stored procedures for creating an analytic workspace cube from a star schema. Is it posible to create a cube from a snoflake schema?
-
How to create functional location for IE02
hi all,
can anyone please tell me that how to create functional location for IE02?
Regards saurabh.To attach a functional location to an equipment, please make sure the following settings,
1- You have defined the installation allowed at functional location for the following equipment category.
2- Make sure status of your equipment is AVLB not ESTO.
then Goto IE02 in the structure tab ---> click change installation location and install the functional location.
Regards,
EJ -
How to create Transaction code for Table Maintanance generator.?
Hi,
I have created a Z Table. and I maintained the Table maintenance generator for the same. Now, my requirement is.. I have to create Transaction code for maintain and Display of this Z table.
Can someone help me how to create the transaction code for Maintain and Display of the table. I know that we have to create a Transaction code for 'SM30'. Can someone tell me the steps to do the same. When I goto SE93 and say CREATE transaction, I get 5 options, Which one to select and what are the details should I provide in the subsequent screens.
Thanks in advance.
Best Regards,
Paddu,Hi,
Check the below steps......
1. Go to Tcode u2018se93u2019.
2. Select ' Transaction with parameters'.
3. Then Transaction 'SM30' with click on skip initial screen
VIEWNAME : XXX9tABLE NAME)
UPDATE : X
4. Maintain the Table maintenance generator
Authorization group : &NC&
Authorization object :
Function group : name(xxx)
Maintenance Screens :
Maintenance type : One step
Maint Screen No : Overview screen (2)
If still u have problem I will send u steps with Screen shot ...send me Yr id.
Regards,
Biswanath -
How to Create Transaction code for a Report
Hi Gurus,
I created some reports and I wants those reports
should be placed in the SAP Menu(initial screen) not
in the User menu in the form of Transaction codes.
I would really appreciate if any one can please send the process to create transaction codes for the User reports/Report groups in R/3 and how to add those created Transaction codes to the SAP MENU.
Thanks in Advance
DanialTry to insert it into the main menu if you must change S000 (there is a function module for everything)? Perhaps SAP protects their menu trees from foreign subnodes in SE43?
Also note that for report transactions you do not need to give the user transaction code start_report. If you do, then they could enter it directly and potentially start many other reports too. The system will call start_report for submitting the report internally without authorizations for it required (unless start_report is maintained in SE97).
Regarding DE, this also confuses me sometimes and I noticed that it generally indicates that I am doing something which has an implication for a SAP standard object. Try either hitting the enter button to see what the next screen is, or, choose original language in the previous screen, or, logon in sy-langu = DE and (remember the path if you dont speak German) change it, or, follow JCs advice to create your own menu. -
How To Create ABAP Code For HR Context Sensitive Structural Authorization
Hello,
We have created a HR Custom Program which IS NOT built off the PCH or PNP Logical Database. As a result, we need to manually create ABAP code for HR Context Sensitive Structural Authorization Check in our custom HR program. Via HR Context Sensitive Structural Authorizations, we are restricting access to personnel numbers and the underlying HRP* tables.
Any assistance would be greatly appreciated with the identification of the SAP standard function modules (Ex. RH_STRU_AUTHORITY_CHECK, HR_CHECK_AUTHORITY_INFTY, HR_CHECK_AUTHORITY_INFTY , etc) used in HR Context Sensitive Structural Authorization Check, how they are used to control HR Structural authorization (P_ORGINCON), and some sample code.
Thank you in advance for all your assistance,
Ken BowersHello Ken
You can use the interface methods IF_EX_HRPAD00AUTH_CHECK to get the same structural authorization as you can see in PA20/PA30. You need to use the methods set_org_assignment and check_authorization for this purpose. For more information you can refer to include FP50PE21 from line 237 onwards till 270.
Regards
Ranganath -
How to create function module for getting customer name
Hi Experts,
How to create function module? when in import parameter kunnr values to be passed it must give name1 details according to the customer number...
how to write the logic in source code....
Regards,
Thiru. R1. First of all create function group.
2. Create function module using this function group.
3. If only one kunnr is needed at a time, create import parameter for it. But if many kunnr to be entered at a time,use table.
4. Fetch name1 for each kunnr from KNA1 table.
"->> if many kunnr
if not t_kunnr[] is initial.
select kunnr as kunnr name1 as name1
into table t_kunnr_name1
from kna1
for all entried in table t_kunnr
where kunnr = t_kunnr-kunnr.
endif.
sort t_kunnr_name1 by kunnr name1.
delete adjacent duplicates from t_kunnr_name1 comparing kunnr name1.
table t_kunnr_name1 will contain kunnr and its name1.
I hope logic is clear for you now.
Regards,
Aparna -
How to create Transaction code for ABAP and execution by other user
Hi All,
Could someone please let me know how to create transaction code in detail for ABAP program. Step by step procedure expected. I would like to know how other user can execute the report using same transaction code which I have created.
More about authorization.
Thanks in advance.Hello,
You can create transaction code from se80 as well.In object navigator,right click on your program name and create->transaction code.You can create transaction and select if it is only a report,a report with selection-screen depending on your requirement.You can run your report directly by entering the transaction code in the command field.
You can authorise the users who can use your transaction:
<b>Authorisation objects</b> are used to restrict certain transactions to users.Critical data must be protected from unauthorised users.For example,the head has access to certain data.But it cannot be accessed by his subordinate.For this we need to define <b>roles</b>.
Create an authorization object with transaction SU21.
An object usually consists of the ACTVT (activity) field and one other field,which specifies the data type to be protected.By ACTVT, we can decide if the data is accessible for change,display only etc.
Add authorization fields to the authorization object created.
Assign the authorization object to the transaction using SE93.
Attach the authorization object to the role using transaction PFCG.
If you want <b>to assign roles</b>,use transaction PFCG.Create a new role.In the AUTHORIZATIONS tab,you can get a self generated profile name and a profile text by clicking on the icon next to it.Then go to the "Change Authorization data" and choose an authorization template.Then you can choose to display/change/create an activity and after the selection,click on the red and white circle.The profile will now be created.
In the user tab,you can give the user details who can use this role.
<b>Also check this link:</b>
http://www.*********************/r3_security/r3_security_tips.htm
http://help.sap.com/saphelp_nw04s/helpdata/en/52/6716a6439b11d1896f0000e8322d00/content.htm
<b>Very helpful guide:</b>
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a92195a9-0b01-0010-909c-f330ea4a585c
Regards,
Beejal
**Reward if answer is helpful -
How to create t-code for a table and how to create transaction variant???
Hi,
I have created a custom table zsark.
Now my requirement is : I have to create a transaction variant zsark_var for sm30 and table zsark. I have to disable the output of the first screen. I have to assign the transaction variant to the transaction code of table zsark.
Now,
1. how to create transaction code to a table. Can any one give me the
staps??
2. how to create transaction variant for the above requirement???
Thanks & Regards,
SarkarHi
1 Goto SE93 transaction
2 Choose 5th option Transaction with parameters
3 Give transaction : SM30, Check Skip Initial Screen Press Enter
4 Goto Bottom left corner, click F4 select viewname, on right hand side give table name
5 Press one more time F4, choose update , mark it X on right side.
6 save the transaction.
Thanks
sandeep
reward if helpful -
How to create t.code for report painter report created using CJE5
Hi All,
I'm trying to create T.code for a report painter program created using CJE5.
I using the D_SREPOVARI-REPORTTYPE as "RE" and
D_SREPOVARI-EXTDREPORT as KP 01RPSCO_X <report name>
If I provide spaces between KP 01RPSCO_X <report name>, its not allowing spaces.
If I didn't provide the space then its saying that "report does not exists"
Please let me know how to overcome this issue?.
What this KP & 01RPSCO_X stands for? Is this always constant?
There is a similar kind of transaction in other system which Looks like this " KP 01RPSCO_X <report name>" spaces in between
I dont understand why its not allowing spaces in this system. As its in different system i cant make a copy of this transaction and change the parameters.
Edited by: Mr A on Feb 18, 2010 5:28 PM
Edited by: Mr A on Feb 18, 2010 5:54 PMthanks for giving me the link.
I searched for all these link in SDN before posting itself.
my issue is how to give the value for the parameater EXTDREPORT.
If i give spaces for the value KP 01RPSCO_X <report name>, its throwing error, T,code its self is inconsistent.
if i didnt give spaces its i'm able to create the t.code, but when i execute it, its giving error message saying "report does not exists"
but if i go to CJE5, that report is there.
thanks -
How to create functional spec. for tds report in sap
hello ,
My client wants to develop tds report as per their desired format. the format is like
DATE OF DEDUCTION/DATE OF CREDIT
NAME OF THE PARTY
SEC
COMP/NON-COMP.
AMOUNT PAID
TDS
SURCHARGE(10%)
ED.CESS(2%)
TOTAL
BSR CODE
CQ/DD NO.
CHAL.SR.NO.
DEPOSIT DATE
PAN NO.
I talked to our abap person.But he said he needs the functional spec to develop the same.But i dont know how to create the functional spec and table join.
I am very new in sap.If possible then Please help me in this regard.
thanks®ards
baishaliHi
In the functional specifications, you need to tell which Tables and Fields should be picked up for displaying the data. Specifically for TDS some of the common tables are WITH_ITEM
Also look at J1IENMIS. Much of teh information you require is there in the new TDS Report for India, though not exactly in the same order
Regards
Sanil
Maybe you are looking for
-
I am in the market for a new HP Laptop.
I am in the market for a new HP Laptop seeing as how my current one is starting to die out on me. I am looking for one that would last me at least 3 or more years like my current has and i kinda have one i like in mind at this link: http://www.bestbu
-
Error while doing a File to IDOC scenario
Hi Experts, I have created a File to IDOC scenario where in i have sent a file which has to pass data to ABSEN1 IDOC.I could see the IDOC reaching R/3 ,but with the status 56: "EDI: Partner profile inbound not available" I have checked with all the c
-
How do I create an artificial horizon indicator?
I need to create an artificial horizon indicator to show pitch and roll. Does anyone have any suggestions on how to accomplish this?
-
Airplay on iPad has just stopped working with Apple TV2
As of today, Airplay on my iPad with Apps that were working (eg TED, ABC iView) transmitting video and sound to Apple TV2 has ceased working. When the Airplay logo on the iPad app is pressed it remains white, not changing to blue as it normally does.
-
LMS 4.1 Configuration Fetch Problem
Hello, I have some problem with WS-C4006 Cisco Catalyst that lms doesn't collect and put into "never collected" area. I also see that those devices doesn't show the classic prompt ">" and "#". Could be the main problem ? If yes how can configure LMS