How to call table control in subscreen in module pool program
Hi all,
I have req,need call table control in subscreen,but have done but when scroll bar value getting changed ,
please guide how to do it.if its possable send the code.
regards
santosh
Hi,
The navigation happens like this.
Consider you have a main screen and 2 subscreens.
When you click or do some event in the Subscreen 2 (lets say this is the one that has the table control), this will first trigger PAI of the Main Screen. In the flow logic of the Main screen, you would have written call subscreen <subscreen area1> and call subscreen <subscreen area2>.
Now the subscreens get triggered based on the order in which you have written in the flow logic.
So, here the modules before the first call subscreen statement in the Main Screen PAI is all executed. Now, it goes to the subscreen on which you have triggered an event and executes the modules in the subscreen.
This is how the execution goes when you have subscreens.
So there is no problem with the navigation. You only have to worry about the screen where you have the table control. Just debug and find where data is getting changed or duplicated.
Similar Messages
-
How to call a text editor from a module pool program
Hi All,
I want to call the text editor from my modulepool program. Enter my text in it and save it.This text needs to be saved in a Z-program with 2 fields as primary keys. The next time while I call this same record from this z table, I need to fetch the existing text and display it.
The user now can put in additional text and can again save it. This process thus goes on..
If anyone has worked in this type of scenario, then please help me in doing this.
Useful answers will surely be rewarded.
Thanks,
Susanth.Hi Sushanth,
We save the text not as fields in a ztable directly but as a text.Please check the format below since it is based on a working code....
first you need to create a text in s010 transaction...
there should be some key based on which you plan to save the text..imagine it is Purchase order then..PO+item numner is always unique.eg:0090010(900PO/item10).so in the code you can append these two and they will be unique..so you can always retrieve them,overwrite,save them anytime you need
**************data declarations
TYPES: BEGIN OF TY_EDITOR,
EDIT(254) TYPE C,
END OF TY_EDITOR.
data: int_line type table of tline with header line.
data: gw_thead like thead.
data: int_table type standard table of ty_editor.
****************fill header..from SO10 t-code..when you save you need the unique key..youfill it here and pass it in save_text function module
GW_THEAD-TDNAME = loc_nam. " unique key for the text -> our unique key to identify the text
GW_THEAD-TDID = 'ST'. " Text ID from SO10
GW_THEAD-TDSPRAS = SY-LANGU. "current language
GW_THEAD-TDOBJECT = 'ZXXX'. "name of the text object created in SO10
*To Read from Container and get data to int_table
CALL METHOD EDITOR ->GET_TEXT_AS_R3TABLE
IMPORTING
TABLE = int_table
EXCEPTIONS
ERROR_DP = 1
ERROR_CNTL_CALL_METHOD = 2
ERROR_DP_CREATE = 3
POTENTIAL_DATA_LOSS = 4
others = 5.
IF SY-SUBRC 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
loop data from int_table and save to int_line-tdline appending it.
*save the text
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
HEADER = GW_THEAD
TABLES
LINES = InT_LINE
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
OBJECT = 4
OTHERS = 5.
IF SY-SUBRC 0.
ENDIF.
*To pass to Container
CALL METHOD EDITOR ->SET_TEXT
hope that the above sample with helps you solve the problem
Please check and revert,
Reward if helpful
Regards
Byju -
Getting error while calling a subscreen in module pool program
HI ALL,
ACTUALLY I'M GETTING A SYNTAX ERROR WHILE I'M CALLING A SUBSCREEN
IN A MODULE POOL PROGRAM IN PAI MODULE
THE ERROR IS AS FOLLOW
"." or "ID ... FIELD ..." expected after "SUBSCREEN"
CAN ANYBODY PLS HELP ME.
REGARDS
ANDREWSHI MAX ,
THE CODE IS AS FOLLOWS:
*& Report ZTABSTRIP_PS
REPORT ZTABSTRIP_PS.
type-pools : vrm.
DATA:number1 type I,
number2 type I,
result type I,
ok_code like SY-UCOMM,
employee1 type c,
ABAP(19) type c,
SALES(19) type c,
HR(19) type c,
MM(19) type c,
employee type c.
emp type c.
CONTROLS tabstrip TYPE TABSTRIP.
CALL SCREEN 100.
call screen 110.
call screen 130.
call screen 120.
call screen 140.
*& Module STATUS_0100 OUTPUT
text
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'STATUS'.
SET TITLEBAR 'TITLE'.
CASE OK_CODE.
WHEN 'BACK' or 'EXIT' or 'DELETE'.
leave program.
WHEN 'SAVE'.
MESSAGE 'please choose a valid function' TYPE 'I'.
WHEN 'BACK'.
leave PROGRAM.
when 'EXIT' or 'DELETE'.
leave to screen 0.
WHEN 'SAVE'.
MESSAGE 'please choose a valid function' TYPE 'I'.
endcase.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
text
MODULE USER_COMMAND_0100 INPUT.
CASE OK_CODE.
when 'TAB1'.
tabstrip-activetab = 'TAB1'.
when 'TAB2'.
tabstrip-activetab = 'TAB2'.
result = number1 + number2.
when 'TAB3'.
tabstrip-activetab = 'TAB3'.
SET TITLEBAR 'TITLE1'.
when 'TAB4'.
tabstrip-activetab = 'TAB4'.
if employee = 'NEERAJ'.
ABAP = 'NEERAJ'.
elseif employee = 'UMESH'.
SALES = 'UMESH'.
ELSEIF employee = 'RAM'.
HR = 'RAM'.
elseif employee = 'ANIL'.
MM = 'ANIL'.
endif.
employee = employee.
WHEN 'BACK'.
leave PROGRAM.
when 'EXIT' or 'DELETE'.
leave to screen 0.
WHEN 'SAVE'.
MESSAGE 'please choose a valid function' TYPE 'I'.
ENDCASE.
WHEN 'BACK' or 'EXIT' or 'DELETE'.
leave program .
WHEN 'SAVE'.
MESSAGE 'please choose a valid function' TYPE 'I'.
endcase.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Module STATUS_0110 OUTPUT
text
**MODULE STATUS_0110 OUTPUT.
SET PF-STATUS 'STATUS1'.
SET TITLEBAR 'xxx'.
**case ok_code.
**WHEN 'back' or 'exit' or 'delete'.
leave PROGRAM.
WHEN 'save'.
MESSAGE 'please choose a valid function ' TYPE 'W'.
ENDCASE.
**ENDMODULE. " STATUS_0110 OUTPUT
*& Module USER_COMMAND_0110 INPUT
text
MODULE USER_COMMAND_0110 INPUT.
number1 = number1.
number2 = number2.
CLEAR NUMBER1.
CLEAR NUMBER2.
REFRESH NUMBER1.
REFRESH NUMBER2.
ENDMODULE. " USER_COMMAND_0110 INPUT
*& Module STATUS_0130 OUTPUT
text
MODULE STATUS_0130 OUTPUT.
SET PF-STATUS 'STATUS2'.
SET TITLEBAR 'xxx'.
RESULT = number1 + number2.
*CLEAR RESULT.
REFRESH RESULT.
ENDMODULE. " STATUS_0130 OUTPUT
*& Module STATUS_0120 OUTPUT
text
MODULE STATUS_0120 OUTPUT.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'xxx'.
DATA: l_name TYPE vrm_id,
li_list TYPE vrm_values,
l_value LIKE LINE OF li_list.
l_value-key = '1'.
l_value-text = 'ANIL'.
APPEND l_value TO li_list.
CLEAR l_value.
CLEAR li_list.
l_value-key = '2'.
l_value-text = 'RAM'.
APPEND l_value TO li_list.
CLEAR l_value.
CLEAR li_list.
l_value-key = '3'.
l_value-text = 'NEERAJ'.
APPEND l_value TO li_list.
CLEAR l_value.
CLEAR li_list.
l_value-key = '4'.
l_value-text = 'UMESH'.
APPEND l_value TO li_list.
CLEAR l_value.
CLEAR li_list.
l_name = 'employee'.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = l_name
VALUES = li_list
EXCEPTIONS
ID_ILLEGAL_NAME = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CLEAR li_list.
ENDMODULE. " STATUS_0120 OUTPUT
*& Module USER_COMMAND_0120 INPUT
text
MODULE USER_COMMAND_0120 INPUT.
INCLUDING sy-repid '140'.
employee1 = employee.
IF employee1 CS 'NEERAJ'.
call SUBSCREEN sub4 .
ABAP = 'NEERAJ'.
CLEAR ABAP.
ELSEIF employee1 CS 'UMESH'.
call SUBSCREEN sub4 .
SALES = 'UMESH'.
CLEAR SALES.
elseif employee1 CS 'RAM'.
call SUBSCREEN sub4 .
HR = 'RAM'.
CLEAR HR.
ELSEIF employee1 CS 'ANIL'.
call SUBSCREEN sub4 .
MM = 'ANIL'.
CLEAR MM.
endif.
ENDMODULE. " USER_COMMAND_0120 INPUT
*& Module STATUS_0140 OUTPUT
text
MODULE STATUS_0140 OUTPUT.
*CASE OK_CODE.
WHEN employee1 'NEERAJ'.
screen-active = 1.
ABAP = 'NEERAJ'.
WHEN employee1 = 'UMESH'.
screen-active = 1.
SALES = 'UMESH'.
WHEN employee1 = 'RAM'.
screen-active = 1.
HR = 'RAM'.
WHEN employee1 = 'ANIL'.
screen-active = 1.
MM = 'ANIL'.
endif.
*ENDCASE.
ENDMODULE. " STATUS_0140 OUTPUT -
Conditional call to a subscreen in module pool program.
Hi,
Could anybody please let me know how i will be able to call a subscreen conditionally in a module pool program?
Example: I have to call a subscreen XXXX if a FLAG = X. How will I achieve this?
I tried to write the below code in PAI
if flag = 'X'.
call subscreen XXXX.
endif.
This produced an error.
Regards,
SmitheshHi
In TOP Include
data repid type sy-repid,
dynnr type sy-dynnr.
In PBO of main screen
module status_100. " First Call This Module to provide the SubScreen Number to below Code
call subscreen sub including repid dynnr. " This serves the purpose of calling subscreen based on condition
in Program.
module status_100.
repid = sy-repid.
if your_condition = 'X'. " This also can be implemented in any PAI logi as its purpose is just to pass a value to DYNNR
dynnr = '200'. " The SUB Screen Number you want to pass
else.
dynnr = '300'. " Dummy Sub Screen Screen or any other (Make Sure these are of SUB SCREEN type )
endif.
endmodule
Cheerz
Ram -
How to access screen field value in a module pool programming?
Hi Experts,
I have create a module pool program SAPMYDLG. It contains two screens 100 and 200.
The first screen contains Employee_ID field. This field is not a dictionary field.
In the second screen 200, I want to access the value of Employee_ID field from first screen.
For this I created a global variable v_empid in TOP include.
Then in the PAI of the screen 100 I have assigned the screen field value to global variable.
v_empid = Employee_ID.
But this gives an error saying " Field Employee_ID not defined".
What am I doing wrong? How can I access the screen field value?
Thanks
GopalHi,
Employee_ID field also must u define in the top include when u define that 100 screen and 200 screen will access.
regards,
muralii -
How to deactivate the screen fields dynamically in Module Pool Program?
Hi guys,
How to <b>activate & deactivate the screen fields</b> of a <b>module pool program</b>
<b>dynamically</b> through program. Like Change mode and display mode in a single
screen.Hi,
Make use of a Variable,say gv_flag, for both Activate and Deactivate functionalities. As many times you hit the same button, change this variable value. For example, let us say first time you hit this button, assign value 'X' to this variable. Second time you hit this button, assign value ' ' to this variable. In PBO based the variable value you have to Activate and Deactivate.
PBO.
if gv_flag = 'X'. " Activate
loop at screen.
if screen-fname = 'ITAB1-MATNR'.
screen-input = '1'.
modify screen.
endif.
endloop.
elseif gv_flag = ' '. " Deactivate
if screen-fname = 'ITAB1-MATNR'.
screen-input = '0'.
modify screen.
endif.
endloop.
endif.
PAI.
case sy-ucomm.
when 'ACDC'. " Activate/Deactivate
if gv_flag = 'X'.
gv_flag = ' '.
else.
gv_flag = 'X'.
endif.
endcase.
thanks,
sksingh -
Table control with wizard in module pool
Hi Gurus!!
First I have an ztable for header and ztable for item of the purchase order. We have the requirement of first uploading the data into ztable and then perform bapi or bdc on it. So, before the data goes into the ztable we have to create screens to show the data,and if any error it should be corrected and then send it to the ztable.
So,in the screen I created a table control using the wizard where I gave the internal table and work area I declared for the item ztable.
Now, I need to give a condition to the table control such that only the details of a single vendor should be displayed in the table control but not all.
Note: The vendor field in the item ztable is the value key and its check table is the header ztable.
I am not able to give a condition in the PAI of the screen where the loop gets created for the table control.
Could someone please help me with this issue.
Thanks and Regards,
Vishwa.Instead of putting a condition to the table control level u can do 1 thing ..create another internal table for ztable (lineitem). And based on ur condition populate this table from the main table and then display this table to the table control.
Regards,
Joy. -
Table Control Scrolling issue in Module Pool
Hi,
I've done table control. From Selection screen i've 3 buttons, if we'll press on one button one table control is visible. There if i do scrolling up to 10 records and i come back to selection and press another button again in table control scrolling is at previous place only. May be its nt refreshing.
Kinldy help on this issue.
With Regards,
jack.hi,
i've done like below. But no result. -
How to write select options with extension in module pool program
hi,
M having the following fields through screen painter.
1. sales offfice
2.sales district
3.customer no
for those three fields no extension is not provided and no search help is there.
i want write seletion options to get extension in that module pool
screen.
plese send coding for me , please let me know how to get that
select options with the above all three fields.
Thanks & Regards
RajiCheck it
In top include
DATA: number(4) TYPE n VALUE '9005',
PROCESS BEFORE OUTPUT.
MODULE status_9001.
CALL SUBSCREEN AREA1 INCLUDING SY-REPID number.
PROCESS AFTER INPUT.
MODULE user_command_9001.
CALL SUBSCREEN AREA1.
*& Module status_9001 OUTPUT
text
MODULE status_9001 OUTPUT.
SELECTION-SCREEN BEGIN OF SCREEN 9005 AS SUBSCREEN.
PARAMETER pa_bukrs TYPE t001-bukrs.
select-options matnr for wa_matnr.
SELECTION-SCREEN END OF SCREEN 9005.
ENDMODULE. " status_9001 OUTPUT -
Subscreen in module pool programming
hello
i want to call to subscreens to subscreen area of main screen dynamically.
i tried using statement under PBO OF MAIN SCREEN flow logic.
<u>call subscreen <sub screen name> including '<program name>' variable1'.</u>
i declared all the things in layout as well as in main program.
data............
<u>variable1 type sy-dynnr.
if ( statement).
variable = 'screen number'.
endif.</u>in this way i have three sub screens.
i am not getting any sytatic errors.
but when i execute this . it showing some message.HI,
CALL SUBSCREEN subscreen_name INCLUDING prog_name dynnr.
where subscreen_name = your subscreen area
prog_name = a variable which holds the name of desired program
dynnr = a variable holding the screen number from the desired program
br -
How to track changes to fields in a Module Pool Program
Hi Experts,
I have one requirement to track the changes to some fields used in the Program, The fields for tracking the changes will be maintained in a table T1, this will be changed dynamically.
There are many screens in the program and many fields in each screen.
1. How to do the coding for tracking the changes, the code should track all the changes to the fields maintained in the table T1.
Thanks in Advance.
BaburajHi Baburaj,
The table logging concept will helpful for this requirement.(Tcode: scu3 --> give table name --> u can find changes for all fields).
Make use of concept change documents (auditing purpose used) --> CDHDR,CDPOS tables.
If you want to track changes to your own program, You need write some API to store the data.
Regards
Bhupal Reddy -
How to add ALV button using OO in module pool program using ALV grid
Hello Gurus!!!
Want some tips related how to add button using ALV Grid(OO).
I want to display the button for search, sort ....
Please suggest the step -by-step procedure for implementation of these button.
I am designing the code for transaction FB03. Header data has been displayed but want to display the line items.
Kindly suggest your answers.
Thanks,
SachinHi,
CLASS SELSCR_APPLICATION DEFINITION DEFERRED.
CLASS SELSCR_APPLICATION DEFINITION.
PUBLIC SECTION.
METHODS:
HANDLE_TOOLBAR
FOR EVENT TOOLBAR OF CL_GUI_ALV_GRID
IMPORTING E_OBJECT E_INTERACTIVE,
HANDLE_USER_COMMAND
FOR EVENT USER_COMMAND OF CL_GUI_ALV_GRID
IMPORTING E_UCOMM.
ENDCLASS. "SELSCR_APPLICATION DEFINITION
CLASS SELSCR_APPLICATION IMPLEMENTATION.
METHOD HANDLE_TOOLBAR.
DATA: LS_TOOLBAR TYPE STB_BUTTON.
append SAVE icon
CLEAR LS_TOOLBAR.
MOVE 'SAVE' TO LS_TOOLBAR-FUNCTION.
MOVE ICON_SYSTEM_SAVE TO LS_TOOLBAR-ICON.
MOVE 'Save' TO LS_TOOLBAR-QUICKINFO.
MOVE ' ' TO LS_TOOLBAR-DISABLED.
APPEND LS_TOOLBAR TO E_OBJECT->MT_TOOLBAR.
CLEAR LS_TOOLBAR.
ENDMETHOD. "handle_toolbar
METHOD HANDLE_USER_COMMAND.
CASE E_UCOMM.
WHEN 'SAVE'.
PERFORM UPDATE_FIELDS.
ENDCASE.
ENDMETHOD.
ENDCLASS. "SELSCR_APPLICATION IMPLEMENTATION
these lines should be after calling method SET_TABLE_FOR_FIRST_DISPLAY
SET HANDLER G_APPLICATION1->HANDLE_TOOLBAR FOR GRID1.
CALL METHOD grid1->set_toolbar_interactive.
rgds,
bharat. -
How to make the field as mandatory in module pool program.
Hi Experts,
Could you please advice me in making a screen field as mandatory input field in module pool programming.
Thanks in advance.Or you could add a check in a PAI module to check if there is some value, if not give error message.
module check_value.
if lv_value is initial.
message e001(00) with 'Enter a value'.
endif.
endmodule
In the PAI screen flow logic...
Process after input.
field lv_value module check_value.
Regards,
Rich Heilman -
How to remove the print popup screen from module pool program
Hi,
In my project i am having one module pool program in which 7-8 screens are there.
In the initial screen after entering the equipment number when i am executing the program then after loading second screen
it is showing one screen is coming which is asking to print the content of the page.
I want to remove this screen (printing popup) but i am not able to get the code or setting for it.
Please help me to solve this problem.
Thanks and regards.I think this is more to do with ABAP than EP so, the corresponding sections of forum could prove more helpful on this...
Thanks,
H -
What is module pool programming?how we can change the standard screen?
Hi EXPERTS
what is module pool programming?how we can change the standard screen using module pool programming ?
please explain with example.Check the below link:
http://wiki.ittoolbox.com/index.php/FAQ:What_is_module_pool_program_in_abap%3F
http://help.sap.com/saphelp_46c/helpdata/en/35/26b1aaafab52b9e10000009b38f974/content.htm
http://sap.mis.cmich.edu/sap-abap/abap09/sld011.htm
http://sap.mis.cmich.edu/sap-abap/abap09/index.htm
http://www.geocities.com/ZSAPcHAT
http://www.allsaplinks.com/files/using_table_in_screen.pdf
http://help.sap.com/saphelp_webas630/helpdata/en/9f/db9cdc35c111d1829f0000e829fbfe/content.htm
http://www.sapdevelopment.co.uk/dialog/dialoghome.htm
http://www.sap-img.com/
http://help.sap.com/saphelp_46c/helpdata/en/08/bef2dadb5311d1ad10080009b0fb56/content.htm
http://www.sapgenie.com/links/abap.htm
http://help.sap.com/saphelp_nw04/helpdata/en/c9/5472fc787f11d194c90000e8353423/frameset.htm
You can also check the transaction ABAPDOCU which gives you lot of sample programs.
Also you can see the below examples...
Go to se38 and give demodynpro and press F4.
YOu will get a list of demo module pool programs.
One more T-Code is ABAPDOCU.
YOu can find more examples there.
See the prgrams:
DEMO_DYNPRO_TABLE_CONTROL_1 Table Control with LOOP Statement
DEMO_DYNPRO_TABLE_CONTROL_2 Table Control with LOOP AT ITAB
http://www.geocities.com/ZSAPcHAT
http://www.allsaplinks.com/files/using_table_in_screen.pdf
regards,
venkat.
Maybe you are looking for
-
Corsair K70 RGB Malfunctioning
I got the new Corsair K70 RGB keyboard in early September, and I've been struggling with Linux compatibility ever since. The keyboard usually works fine in Windows, with a couple of very irregular glitches, and it works as well in grub. My Arch setup
-
Creating an ins​trument handler/driver in CVI
I am reposting a question I had last week about creating a server/instrument in an app, with a slight change. I have an application that I have to interface to. This existing application is a LabView based app which connects to and controls different
-
Hi, Can anyone plz tell me how to use the pricing type in item category? also request for telling me, what the pricing type "K" stands for. Regards. amit
-
limited use on tablet, isthis normal?
-
How to use rotoscoped layer as mask or track matte
I'm doing some work between a 3d program and after effects cs6. Is there a way to use a rotoscoped layer as either a mask or a track matte for a different layer? Have tried it as a luma matte without success. DO I need to precompose anything? Thanks