Required module pool programming sample exercises to learn MP urgent
sample exercises to learn MP urgent if any one having please send it to me.
Thanks
Please refer to the links below. Reward points if useful.
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCDWBTUT/BCDWBTUT.pdf
http://help.sap.com/saphelp_40b/helpdata/en/d3/2e974d35c511d1829f0000e829fbfe/applet.htm
Have a look at these good links-
http://www.allsaplinks.com/dialog_programming.html
http://sap.mis.cmich.edu/sap-abap/abap09/
http://www.sapdevelopment.co.uk/dialog/dialoghome.htm
http://help.sap.com/saphelp_webas630/helpdata/en/9f/db9cdc35c111d1829f0000e829fbfe/content.htm
http://sap.mis.cmich.edu/abap-00/
http://www.allsaplinks.com/files/using_table_in_screen.pdf
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
http://help.sap.com
http://www.sapgenie.com/abap/example_code.htm
http://help.sap.com/saphelp_47x200/helpdata/en/52/670ba2439b11d1896f0000e8322d00/frameset.htm
http://www.allsaplinks.com/dialog_programming.html
http://www.sapbrain.com/TUTORIALS/default.html
http://www.sappoint.com/abap/spmp.pdf
http://sappoint.com/abap.html
http://www.sap-img.com/abap.htm
http://sap.ittoolbox.com/code/archives.asp?i=10&t=450&a=t
http://www.sapdevelopment.co.uk/dialog/dialoghome.htm
http://www.sap-img.com/abap/
http://www.sap-img.com/
http://www.sappoint.com/faq/faqdiapr.pdf
http://www.allsaplinks.com/dialog_programming.html
http://www.sapgenie.com/abap/example_code.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
http://www.sapdevelopment.co.uk/dialog/dialoghome.htm
Similar Messages
-
Hi,
I have no specific question regarding the module pool program, but want to learn it from beginning.
can anyone help me by sending the Module pool programming material and table control.
Thanks,Hi
hope it will help you.
reward if help.
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 -
Plz provide tutorial to learn the Module pool programing?
Hello,
Please provide me with the Tutorials which will be helpful to learn Module Pool Programming.
If any one can provide me with the screen shots then it would be great!
ANy help would be appreciated......
Thank You!
Krishna ChaitanyaHi,
Screens are the most general type of user dialog that you can use in ABAP programs. You do not define them in ABAP programs, but instead in the Screen Painter. A screen consists of the input/output mask and the flow logic. You can define screens for any program with type 1, M, or F.
The screens in a single ABAP program can be combined to form screen sequences. You can call single screens or screen sequences either using a transaction code from outside the ABAP program, or by using the CALL SCREEN statement in the corresponding ABAP program. When you call a screen or screen sequence, the screen flow logic takes control of the ABAP program execution. You can define screen sequences dynamically by setting the next screen attribute for a screen dynamically in the ABAP program.
A screen consists of the input/output mask and the flow logic. The screen flow logic is divided into the Process Before Output (PBO) event, which is processed before the screen is displayed, and the Process After Input (PAI) event, which is processed after a user action on the screen.
The following diagram shows the place of screens between the GUI status and the ABAP program:
The screen flow logic calls dialog modules in the ABAP program, either to prepare the screen for display (PBO event) or to process the user's entries (PAI event). Screens are dynamic programs, and have their own data objects, called screen fields. These are linked to the input/output fields that appear on the screen itself. When the screen is displayed, and when it finishes processing, the system passes data between the screen fields and data objects in the ABAP program. Data is copied between identically-named fields.
Each screen has a GUI status, containing a menu bar, standard toolbar, and an application toolbar. Like screens, GUI statuses are independent components of the ABAP program. You create them in the ABAP Workbench using the Menu Painter. You assign GUI statuses to screens dynamically in your ABAP programs. Each screen is linked to the current GUI status by a special screen field into which the corresponding function code is placed whenever the user chooses a function. The screen passes the function code to the ABAP program just like any other screen field. You can then read it in the program.
Screen Attributes
Like all objects in the R/3 Repository, screens have attributes that both describe them and determine how they behave at runtime. Important screen attributes for ABAP programming:
Program
The name of the ABAP program (type 1, M, or F) to which the screen belongs.
Screen number
A four-digit number, unique within the ABAP program, that identifies the screen within the program. If your program contains selection screens, remember that selection screens and Screen Painter screens use the same namespace. For example, if you have a program with a standard selection screen, you may not contain any further screens with the number 1000. Lists, on the other hand, have their own namespace.
Screen type
A normal screen occupies a whole GUI window. Modal dialog boxes only cover a part of a GUI window. Their interface elements are also arranged differently. Selection screens are generated automatically from the definition in the ABAP program. You may not define them using the Screen Painter. A subscreen is a screen that you can display in a subscreen area on a different screen in the same ABAP program.
Next screen
Statically-defined screen number, specifying the next screen in the sequence. If you enter zero or leave the field blank, you define the current screen as the last in the chain. If the next screen is the same as the current screen, the screen will keep on calling itself. You can override the statically-defined next screen in the ABAP program.
Cursor position
Static definition of the screen element on which the cursor is positioned when the screen is displayed. By default, the cursor appears on the first input field. You can overwrite the static cursor position dynamically in your ABAP program.
Screen group
Four-character ID, placed in the system field SY-DYNGR while the screen is being processed. This allows you to assign several screens to a common screen group. You can use this, for example, to modify all of the screens in the group in a uniform way. Screen groups are stored in table TFAWT.
Hold data
If the user calls the screen more than once during a terminal session, he or she can retain changed data as default values by choosing System ® User profile ® Hold data.
Screen Attributes
Like all objects in the R/3 Repository, screens have attributes that both describe them and determine how they behave at runtime. Important screen attributes for ABAP programming:
Program
The name of the ABAP program (type 1, M, or F) to which the screen belongs.
Screen number
A four-digit number, unique within the ABAP program, that identifies the screen within the program. If your program contains selection screens, remember that selection screens and Screen Painter screens use the same namespace. For example, if you have a program with a standard selection screen, you may not contain any further screens with the number 1000. Lists, on the other hand, have their own namespace.
Screen type
A normal screen occupies a whole GUI window. Modal dialog boxes only cover a part of a GUI window. Their interface elements are also arranged differently. Selection screens are generated automatically from the definition in the ABAP program. You may not define them using the Screen Painter. A subscreen is a screen that you can display in a subscreen area on a different screen in the same ABAP program.
Next screen
Statically-defined screen number, specifying the next screen in the sequence. If you enter zero or leave the field blank, you define the current screen as the last in the chain. If the next screen is the same as the current screen, the screen will keep on calling itself. You can override the statically-defined next screen in the ABAP program.
Cursor position
Static definition of the screen element on which the cursor is positioned when the screen is displayed. By default, the cursor appears on the first input field. You can overwrite the static cursor position dynamically in your ABAP program.
Screen group
Four-character ID, placed in the system field SY-DYNGR while the screen is being processed. This allows you to assign several screens to a common screen group. You can use this, for example, to modify all of the screens in the group in a uniform way. Screen groups are stored in table TFAWT.
Hold data
If the user calls the screen more than once during a terminal session, he or she can retain changed data as default values by choosing System ® User profile ® Hold data.
Check the below link:
http://sap.mis.cmich.edu/sap-abap/abap09/index.htm
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
You can also check the transaction ABAPDOCU which gives you lot of sample programs.
Regards
Kiran Sure -
How to get tree structure navigation in module pool program
please send me a sample code for getting tree structure navigation in a screen in module pool program.
ex.
masters
itemsdo a chain and endchain on the fields.Then insert the fields in to the required database.
-
Doubt regarding module pool program
Hi experts,
I need to use bapi in module pool program
can we use it ? I hope we can use,
Please any body give some sample code
Thanks in advance
Rangabapi like another function module can be used in module pool based ojn ur desire
a sample code is :
case sy-ucomm.
when 'create'
call bapi u require
end case
hope it gives u an idea
regards
navjot
reward accordingly -
Plz send some help on module pool programming
send some help on module pool programming
Bluefox,
SDN is not providing online learnning program. it is a forum catagery place where guys comes with real time problems.
you should try to search by your self in GOOGLE.
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
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
please close this thread. -
Data insert through module pool programming
hi
I want to insert the data into the data base through module pool programming.I am taking the fields from different tables, I need sample code ,please help meHi Dhanunjay,
REPORT zpe_str_le .
TABLES : zpe_str , zprd_mis1 , mseg , t001l.
*DATA : STR TYPE C VALUE '50'.
data : text(100) VALUE 'DELETED STORAGE LOCATION NO '.
SELECTION-SCREEN : BEGIN OF SCREEN 123 AS WINDOW TITLE TEXT-005.
SELECT-OPTIONS : S_ZSLOC FOR ZPE_STR-ZSLOC,
S_ZMACD FOR ZPE_STR-ZMACD,
S_ZPGRP FOR ZPE_STR-ZPGRP.
SELECTION-SCREEN : END OF SCREEN 123.
DATA : flag(1) TYPE c,
flag1 TYPE c ,
flag3 TYPE c VALUE '1'.
DATA : etab LIKE t001l OCCURS 0 WITH HEADER LINE.
SELECT * FROM T001L INTO TABLE ETAB.
DATA : ihead LIKE thead.
DATA : prevtab LIKE tline OCCURS 0 WITH HEADER LINE.
data : Jtab like TLINE occurs 0 with header line.
DATA : jtab LIKE tline OCCURS 0 WITH HEADER LINE.
DATA : itab LIKE zprd_mis1 OCCURS 0 WITH HEADER LINE.
*SELECT * FROM zprd_mis1 INTO TABLE itab.
DATA : BEGIN OF itab_sloc OCCURS 0,
werks LIKE t001l-werks,
lgort LIKE t001l-lgort,
lgobe LIKE t001l-lgobe,
END OF itab_sloc.
*FLAG = 0.
CALL SCREEN 100.
MODULE user_command_0100 INPUT.
CASE sy-ucomm.
WHEN 'RET'.
LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 100.
*PERFORM PREVIEW.
LOOP AT prevtab.
WRITE : / prevtab.
ENDLOOP.
LOOP AT JTAB[] INTO ZPRD_MIS1.
WRITE : Jtab-TDFORMAT.
WRITE : Jtab-TDLINE .
*********ZPRD_MIS1-MANDT = Jtab-TDLINE .
*********ZPRD_MIS1-SLOC = Jtab-TDLINE .
*********ZPRD_MIS1-MCODE = Jtab-TDLINE .
*********ZPRD_MIS1-GCODE = Jtab-TDLINE .
*********ZPRD_MIS1-DESCR = Jtab-TDLINE .
*********INSERT ZPRD_MIS1.
ENDLOOP.
WRITE : JTAB-ZSLOC.
*********CALL TRANSACTION 'SO10'.
SET CURSOR 2 2.
WHEN 'DET'.
SELECT * FROM ZPRD_MIS1 INTO CORRESPONDING FIELDS OF TABLE ITAB.
CALL SCREEN 123 STARTING AT 10 5.
LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0.
SKIP 2 .
WRITE :/1(8) 'STR.LOC' ,10(15) 'MRP. CTLR',27(10) 'P.GRP' ,39(40) 'DESCRIPTION OF PRODUCT'.
SELECT SLOC MCODE GCODE DESCR FROM zprd_mis1 INTO ZPRD_MIS1 WHERE SLOC IN S_ZSLOC AND
MCODE IN S_ZMACD AND
GCODE IN S_ZPGRP.
WRITE :/1(8) zprd_mis1-SLOC ,10(15) zprd_mis1-MCODE ,27(10) zprd_mis1-GCODE ,39(40) zprd_mis1-DESCR .
ENDSELECT.
WHEN 'CLEAR'.
flag = 4.
IF zpe_str-zsloc NE ' '.
CLEAR zpe_str.
ELSE.
MESSAGE 'ALREADY CLEARED' TYPE 'S'.
ENDIF.
WHEN 'EXIT'.
LEAVE TO SCREEN 0.
WHEN 'SAVE'.
IF zpe_str-zdesc NE ' '.
IF zpe_str-zsloc NE ' '.
LOOP AT itab.
READ TABLE itab WITH KEY sloc = zpe_str-zsloc .
IF sy-subrc = 0 AND flag = 5.
zprd_mis1-mandt = sy-mandt.
zprd_mis1-sloc = zpe_str-zsloc .
zprd_mis1-mcode = zpe_str-zmacd .
zprd_mis1-gcode = zpe_str-zpgrp.
zprd_mis1-descr = zpe_str-zdesc .
MODIFY zprd_mis1.
flag1 = 7.
MESSAGE 'STORAGE LOCATION MODIFIED' TYPE 'S'.
EXIT.
ELSE.
zprd_mis1-mandt = sy-mandt.
zprd_mis1-sloc = zpe_str-zsloc .
zprd_mis1-mcode = zpe_str-zmacd .
zprd_mis1-gcode = zpe_str-zpgrp.
zprd_mis1-descr = zpe_str-zdesc .
INSERT zprd_mis1.
APPEND itab.
flag = 5.
flag1 = 7.
MESSAGE 'STORAGE LOCATION CREATED' TYPE 'S'.
*MESSAGE 'DATA ALREADY SAVED' TYPE 'S'.
EXIT.
*ENDIF.
ENDIF.
ENDLOOP.
ELSE.
flag = 3.
MESSAGE 'PLEASE ENTER THE STORAGE LOCATION' TYPE 'S'.
ENDIF.
ELSE.
LOOP AT itab.
READ TABLE itab WITH KEY sloc = zpe_str-zsloc .
IF sy-subrc = 0.
MESSAGE 'ALREADY SAVED' TYPE 'S'.
ELSE.
MESSAGE 'ENTRIES FOR OTHER FIELDS REQUIRED' TYPE 'S'.
ENDIF.
ENDLOOP.
ENDIF.
WHEN 'CHECK'.
SELECT * FROM zprd_mis1 INTO TABLE itab.
IF zpe_str-zsloc NE ' '.
LOOP AT itab.
READ TABLE itab WITH KEY sloc = zpe_str-zsloc .
IF sy-subrc = 0.
zpe_str-zmandt = itab-mandt.
zpe_str-zsloc = itab-sloc.
zpe_str-zmacd = itab-mcode.
zpe_str-zpgrp = itab-gcode.
zpe_str-zdesc = itab-descr.
flag = 7.
flag1 = 7.
ELSE.
MESSAGE 'NO SUCH STORAGE LOCATION AVAILABLE' TYPE 'S'.
EXIT.
ENDIF.
ENDLOOP.
ELSE.
flag = 3.
MESSAGE 'PLEASE ENTER THE STORAGE LOCATION' TYPE 'S'.
EXIT.
ENDIF.
WHEN 'DELETE'.
IF zpe_str-zsloc EQ ' '.
flag = 3.
MESSAGE 'NOSUCH LOCATION AVAILABLE' TYPE 'S'.
ELSE.
READ TABLE itab WITH KEY sloc = zpe_str-zsloc .
IF sy-subrc = 0.
zpe_str-zmandt = itab-mandt.
zpe_str-zsloc = itab-sloc.
zpe_str-zmacd = itab-mcode.
zpe_str-zpgrp = itab-gcode.
zpe_str-zdesc = itab-descr.
IF zpe_str-zsloc NE ' '.
CALL FUNCTION 'G_CHECK_PASSWORD'
EXPORTING
password = 'PLANT1'
EXCEPTIONS
not_authorized = 1
canceled = 2
OTHERS = 3.
IF sy-subrc = 0.
PERFORM PREVIEW.
DELETE FROM zprd_mis1 WHERE SLOC = zpe_str-zSLOC.
UPDATE zprd_mis1.
APPEND itab.
MESSAGE 'STORAGE LOCATION DELETED' TYPE 'S'.
ELSEIF SY-SUBRC = 2.
MESSAGE 'OPRATION CANCELLED' TYPE 'E'.
ELSEIF SY-SUBRC = 3.
MESSAGE 'UNAUTHORIZED' TYPE 'E'.
ENDIF.
ELSE.
MESSAGE 'STORAGE LOCATION CONTAINS NO DATA' TYPE 'S'.
ENDIF.
ELSE.
MESSAGE 'STORAGE LOCATION CONTAINS NO DATA' TYPE 'S'.
ENDIF.
ENDIF.
WHEN 'CREATE'.
FLAG3 = 12.
IF zpe_str-zsloc EQ ' '.
MESSAGE 'ENTER THE STORAGE LOCATION' TYPE 'S'.
EXIT.
ELSE.
LOOP AT etab.
READ TABLE etab WITH KEY lgort = zpe_str-zsloc .
IF sy-subrc = 0.
read table itab with key sloc = zpe_str-zsloc .
if sy-subrc = 0.
zpe_str-zmandt = itab-mandt.
zpe_str-zsloc = itab-sloc.
zpe_str-zmacd = itab-mcode.
zpe_str-zpgrp = itab-gcode.
zpe_str-zdesc = itab-descr.
flag = 7.
flag1 = 7.
clear flag .
clear flag1.
message 'storage location alredy exist' type 'S'.
ELSE.
FLAG = 2.
MESSAGE 'STORAGE LOCATION ENTIRES DOESNOT EXIST' TYPE 'S'.
ENDIF.
else.
message 'no such storage location exist' type 'S'.
endif.
endloop.
FLAG = 2.
exit.
endif.
WHEN 'CHANGE'.
SELECT * FROM zprd_mis1 INTO TABLE itab.
IF zpe_str-zsloc NE ' '.
LOOP AT itab.
READ TABLE itab WITH KEY sloc = zpe_str-zsloc .
IF sy-subrc = 0.
flag = 5.
flag1 = 6.
zpe_str-zmandt = itab-mandt.
zpe_str-zsloc = itab-sloc.
zpe_str-zmacd = itab-mcode.
zpe_str-zpgrp = itab-gcode.
zpe_str-zdesc = itab-descr.
ELSE.
MESSAGE 'NO STORAGE LOCATION AVAILABLE' TYPE 'S'.
ENDIF.
ENDLOOP.
ELSE.
flag = 3.
MESSAGE 'PLEASE ENTER THE STORAGE LOCATION' TYPE 'S'.
ENDIF.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Module STATUS_0100 OUTPUT
text
MODULE status_0100 OUTPUT.
SET PF-STATUS 'AAA'.
SET TITLEBAR 'aaa'.
IF flag3 = '1'.
CALL FUNCTION 'G_CHECK_PASSWORD'
EXPORTING
password = 'PLANT1'
EXCEPTIONS
not_authorized = 1
canceled = 2
OTHERS = 3.
IF sy-subrc 0.
MESSAGE 'un authorized' TYPE 'S'(001).
LEAVE TO SCREEN 0.
ELSEIF SY-SUBRC = 2.
MESSAGE ' OPERATION CANCELLED' TYPE 'S'(001).
LEAVE TO SCREEN 0.
ELSEIF SY-SUBRC = 3.
LEAVE TO SCREEN 0.
MESSAGE 'RESTRICTED' TYPE 'S'(001).
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CLEAR flag3.
ENDIF.
SELECT * FROM zprd_mis1 INTO TABLE itab.
LOOP AT SCREEN.
IF screen-name = 'ZPE_STR-ZDESC' OR screen-name = 'ZPE_STR-ZPGRP' OR screen-name = 'ZPE_STR-ZMACD'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
IF flag = 5 AND flag1 EQ 6.
LOOP AT SCREEN.
IF screen-name = 'ZPE_STR-ZDESC' OR screen-name = 'ZPE_STR-ZPGRP' OR screen-name = 'ZPE_STR-ZMACD'.
screen-input = 1.
MODIFY SCREEN.
ENDIF.
IF screen-name = 'CREATE' OR screen-name = 'DELETE' OR screen-name = 'CHANGE' OR screen-name = 'CHECK'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
EXIT.
ENDIF.
IF flag = 2.
LOOP AT SCREEN.
IF screen-name = 'ZPE_STR-ZDESC' OR screen-name = 'ZPE_STR-ZPGRP' OR screen-name = 'ZPE_STR-ZMACD'.
screen-input = 1.
MODIFY SCREEN.
ENDIF.
IF screen-name = 'CREATE' OR screen-name = 'DELETE' OR screen-name = 'CHANGE' OR screen-name = 'CHECK'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
EXIT.
ENDIF.
IF flag3 = 12.
LOOP AT SCREEN.
IF screen-name = 'ZPE_STR-ZDESC' OR screen-name = 'ZPE_STR-ZPGRP' OR screen-name = 'ZPE_STR-ZMACD'.
screen-input = 1.
MODIFY SCREEN.
ENDIF.
IF screen-name = 'CREATE' OR screen-name = 'DELETE' OR screen-name = 'CHANGE' OR screen-name = 'RET' OR screen-name = 'CHECK'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
EXIT.
CLEAR FLAG3.
ENDIF.
IF flag = 4.
IF screen-name CP 'ZPE_*'.
screen-input = 1.
ENDIF.
ENDIF.
IF flag1 = 7 AND flag = 5.
LOOP AT SCREEN.
IF screen-name = 'ZPE_STR-ZDESC' OR screen-name = 'ZPE_STR-ZSLOC' OR screen-name = 'ZPE_STR-ZPGRP' OR screen-name = 'ZPE_STR-ZMACD'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
IF screen-name = 'CREATE' OR screen-name = 'DELETE' OR screen-name = 'CHECK' OR screen-name = 'SAVE'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
IF flag1 = 7 AND flag = 7.
LOOP AT SCREEN.
IF screen-name = 'ZPE_STR-ZDESC' OR screen-name = 'ZPE_STR-ZSLOC' OR screen-name = 'ZPE_STR-ZPGRP' OR screen-name = 'ZPE_STR-ZMACD'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
IF screen-name = 'CREATE' OR screen-name = 'CHECK' OR screen-name = 'SAVE'." OR screen-name = 'DELETE'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
IF flag1 = 4 AND flag = 3.
LOOP AT SCREEN.
IF screen-name = 'ZPE_STR-ZDESC' OR screen-name = 'ZPE_STR-ZSLOC' OR screen-name = 'ZPE_STR-ZPGRP' OR screen-name = 'ZPE_STR-ZMACD'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
IF screen-name = 'CREATE' OR screen-name = 'SAVE' OR screen-name = 'DELETE' OR screen-name = 'CHANGE' OR screen-name = 'CHECK'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
DATA: BEGIN OF r1 OCCURS 1.
INCLUDE STRUCTURE ddshretval.
DATA: END OF r1.
*& Module VALUE_SLOC INPUT
text
MODULE value_sloc INPUT.
SELECT lgort werks lgobe FROM t001l INTO CORRESPONDING FIELDS OF TABLE itab_sloc.
DELETE ADJACENT DUPLICATES FROM itab_sloc COMPARING lgort.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'LGORT'
value_org = 'S'
TABLES
value_tab = itab_sloc
return_tab = r1
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc EQ 0.
IF r1-fieldval IS NOT INITIAL.
zpe_str-zsloc = r1-fieldval.
ENDIF.
ENDIF.
EXIT.
*ENDSELECT.
ENDMODULE. " VALUE_SLOC INPUT
FORM PREVIEW.
*TABLES : ZPE_STR , ZPRD_MIS1 , MSEG.
data : ihead like thead.
DATA : prevtab like TLINE occurs 0 with header line.
data : Jtab like TLINE occurs 0 with header line.
*data : Jtab like thead occurs 0 with header line.
*data : text(100).
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = 'ST'
LANGUAGE = sy-langu
NAME = 'ZSLDEL'
OBJECT = 'TEXT'
ARCHIVE_HANDLE = 0
LOCAL_CAT = ' '
IMPORTING
HEADER =
TABLES
LINES = prevtab[]
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8
IF SY-SUBRC 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
if not prevtab[] is initial.
append lines of prevtab to jtab.
endif.
*IHEAD-TDFDATE = SY-DATUM.
*IHEAD-TDFTIME = SY-UZEIT.
ihead-TDOBJECT = 'TEXT'.
ihead-TDNAME = 'ZSLDEL'.
ihead-TDID = 'ST'.
ihead-TDSPRAS = sy-langu.
type-pools : slis.
Jtab-TDFORMAT = ''.
*Jtab-TDLINE = 'SLOCATION'.
*append Jtab.
*Jtab-TDFORMAT = ''.
Jtab-TDFORMAT = '*'.
Jtab-TDLINE = ZPE_STR-ZSLOC.
append Jtab.
Jtab-TDFORMAT = ''.
*Jtab-TDLINE = 'DATE'.
*append Jtab.
Jtab-TDFORMAT = ''.
*Jtab-TDLINE = SY-DATUM.
*append Jtab.
Jtab-TDFORMAT = ''.
*Jtab-TDLINE = 'TIME'.
*append Jtab.
Jtab-TDFORMAT = ''.
*Jtab-TDLINE = SY-UZEIT.
*Jtab-TDFORMAT = ''.
*append Jtab.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
CLIENT = SY-MANDT
HEADER = ihead
INSERT = 'X'
SAVEMODE_DIRECT = ' '
OWNER_SPECIFIED = ' '
LOCAL_CAT = ' '
IMPORTING
FUNCTION =
NEWHEADER =
TABLES
LINES = Jtab
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
OBJECT = 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.
CALL FUNCTION 'COMMIT_TEXT'
EXPORTING
OBJECT = '*'
NAME = '*'
ID = '*'
LANGUAGE = '*'
SAVEMODE_DIRECT = ' '
KEEP = ' '
LOCAL_CAT = ' '
IMPORTING
COMMIT_COUNT =
TABLES
T_OBJECT =
T_NAME =
T_ID =
T_LANGUAGE =
ENDFORM.
*&spwizard: declaration of tablecontrol 'TBLECTL' itself
controls: TBLECTL type tableview using screen 0100.
*&spwizard: lines of tablecontrol 'TBLECTL'
data: g_TBLECTL_lines like sy-loopc.
data: OK_CODE like sy-ucomm.
*&spwizard: output module for tc 'TBLECTL'. do not change this line!
*&spwizard: update lines for equivalent scrollbar
module TBLECTL_change_tc_attr output.
describe table ITAB lines TBLECTL-lines.
endmodule.
*&spwizard: output module for tc 'TBLECTL'. do not change this line!
*&spwizard: get lines of tablecontrol
module TBLECTL_get_lines output.
g_TBLECTL_lines = sy-loopc.
endmodule.
*&spwizard: input module for tc 'TBLECTL'. do not change this line!
*&spwizard: process user command
module TBLECTL_user_command input.
OK_CODE = sy-ucomm.
perform user_ok_tc using 'TBLECTL'
'ITAB'
changing OK_CODE.
sy-ucomm = OK_CODE.
endmodule.
INCLUDE TABLECONTROL_FORMS *
*& Form USER_OK_TC *
FORM USER_OK_TC USING P_TC_NAME TYPE DYNFNAM
P_TABLE_NAME
P_MARK_NAME
CHANGING P_OK LIKE SY-UCOMM.
&SPWIZARD: BEGIN OF LOCAL DATA----
DATA: L_OK TYPE SY-UCOMM,
L_OFFSET TYPE I.
&SPWIZARD: END OF LOCAL DATA----
*&SPWIZARD: Table control specific operations *
*&SPWIZARD: evaluate TC name and operations *
SEARCH P_OK FOR P_TC_NAME.
IF SY-SUBRC 0.
EXIT.
ENDIF.
L_OFFSET = STRLEN( P_TC_NAME ) + 1.
L_OK = P_OK+L_OFFSET.
*&SPWIZARD: execute general and TC specific operations *
CASE L_OK.
WHEN 'INSR'. "insert row
PERFORM FCODE_INSERT_ROW USING P_TC_NAME
P_TABLE_NAME.
CLEAR P_OK.
WHEN 'DELE'. "delete row
PERFORM FCODE_DELETE_ROW USING P_TC_NAME
P_TABLE_NAME
P_MARK_NAME.
CLEAR P_OK.
WHEN 'P--' OR "top of list
'P-' OR "previous page
'P+' OR "next page
'P++'. "bottom of list
PERFORM COMPUTE_SCROLLING_IN_TC USING P_TC_NAME
L_OK.
CLEAR P_OK.
WHEN 'L--'. "total left
PERFORM FCODE_TOTAL_LEFT USING P_TC_NAME.
WHEN 'L-'. "column left
PERFORM FCODE_COLUMN_LEFT USING P_TC_NAME.
WHEN 'R+'. "column right
PERFORM FCODE_COLUMN_RIGHT USING P_TC_NAME.
WHEN 'R++'. "total right
PERFORM FCODE_TOTAL_RIGHT USING P_TC_NAME.
WHEN 'MARK'. "mark all filled lines
PERFORM FCODE_TC_MARK_LINES USING P_TC_NAME
P_TABLE_NAME
P_MARK_NAME .
CLEAR P_OK.
WHEN 'DMRK'. "demark all filled lines
PERFORM FCODE_TC_DEMARK_LINES USING P_TC_NAME
P_TABLE_NAME
P_MARK_NAME .
CLEAR P_OK.
WHEN 'SASCEND' OR
'SDESCEND'. "sort column
PERFORM FCODE_SORT_TC USING P_TC_NAME
l_ok.
ENDCASE.
ENDFORM. " USER_OK_TC
*& Form FCODE_INSERT_ROW *
FORM fcode_insert_row
USING P_TC_NAME TYPE DYNFNAM
P_TABLE_NAME .
&SPWIZARD: BEGIN OF LOCAL DATA----
DATA L_LINES_NAME LIKE FELD-NAME.
DATA L_SELLINE LIKE SY-STEPL.
DATA L_LASTLINE TYPE I.
DATA L_LINE TYPE I.
DATA L_TABLE_NAME LIKE FELD-NAME.
FIELD-SYMBOLS <TC> TYPE CXTAB_CONTROL.
FIELD-SYMBOLS <TABLE> TYPE STANDARD TABLE.
FIELD-SYMBOLS <LINES> TYPE I.
&SPWIZARD: END OF LOCAL DATA----
ASSIGN (P_TC_NAME) TO <TC>.
*&SPWIZARD: get the table, which belongs to the tc *
CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
ASSIGN (L_TABLE_NAME) TO <TABLE>. "not headerline
*&SPWIZARD: get looplines of TableControl *
CONCATENATE 'G_' P_TC_NAME '_LINES' INTO L_LINES_NAME.
ASSIGN (L_LINES_NAME) TO <LINES>.
*&SPWIZARD: get current line *
GET CURSOR LINE L_SELLINE.
if sy-subrc 0. " append line to table
l_selline = <tc>-lines + 1.
*&SPWIZARD: set top line *
if l_selline > <lines>.
<tc>-top_line = l_selline - <lines> + 1 .
else.
<tc>-top_line = 1.
endif.
else. " insert line into table
l_selline = <tc>-top_line + l_selline - 1.
l_lastline = <tc>-top_line + <lines> - 1.
endif.
*&SPWIZARD: set new cursor line *
l_line = l_selline - <tc>-top_line + 1.
*&SPWIZARD: insert initial line *
INSERT INITIAL LINE INTO <TABLE> INDEX L_SELLINE.
<TC>-LINES = <TC>-LINES + 1.
*&SPWIZARD: set cursor *
SET CURSOR LINE L_LINE.
ENDFORM. " FCODE_INSERT_ROW
*& Form FCODE_DELETE_ROW *
FORM fcode_delete_row
USING P_TC_NAME TYPE DYNFNAM
P_TABLE_NAME
P_MARK_NAME .
&SPWIZARD: BEGIN OF LOCAL DATA----
DATA L_TABLE_NAME LIKE FELD-NAME.
FIELD-SYMBOLS <TC> TYPE cxtab_control.
FIELD-SYMBOLS <TABLE> TYPE STANDARD TABLE.
FIELD-SYMBOLS <WA>.
FIELD-SYMBOLS <MARK_FIELD>.
&SPWIZARD: END OF LOCAL DATA----
ASSIGN (P_TC_NAME) TO <TC>.
*&SPWIZARD: get the table, which belongs to the tc *
CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
ASSIGN (L_TABLE_NAME) TO <TABLE>. "not headerline
*&SPWIZARD: delete marked lines *
DESCRIBE TABLE <TABLE> LINES <TC>-LINES.
LOOP AT <TABLE> ASSIGNING <WA>.
*&SPWIZARD: access to the component 'FLAG' of the table header *
ASSIGN COMPONENT P_MARK_NAME OF STRUCTURE <WA> TO <MARK_FIELD>.
IF <MARK_FIELD> = 'X'.
DELETE <TABLE> INDEX SYST-TABIX.
IF SY-SUBRC = 0.
<TC>-LINES = <TC>-LINES - 1.
ENDIF.
ENDIF.
ENDLOOP.
ENDFORM. " FCODE_DELETE_ROW
*& Form COMPUTE_SCROLLING_IN_TC
text
-->P_TC_NAME name of tablecontrol
-->P_OK ok code
FORM COMPUTE_SCROLLING_IN_TC USING P_TC_NAME
P_OK.
&SPWIZARD: BEGIN OF LOCAL DATA----
DATA L_TC_NEW_TOP_LINE TYPE I.
DATA L_TC_NAME LIKE FELD-NAME.
DATA L_TC_LINES_NAME LIKE FELD-NAME.
DATA L_TC_FIELD_NAME LIKE FELD-NAME.
FIELD-SYMBOLS <TC> TYPE cxtab_control.
FIELD-SYMBOLS <LINES> TYPE I.
&SPWIZARD: END OF LOCAL DATA----
ASSIGN (P_TC_NAME) TO <TC>.
*&SPWIZARD: get looplines of TableControl *
CONCATENATE 'G_' P_TC_NAME '_LINES' INTO L_TC_LINES_NAME.
ASSIGN (L_TC_LINES_NAME) TO <LINES>.
*&SPWIZARD: is no line filled? *
IF <TC>-LINES = 0.
*&SPWIZARD: yes, ... *
L_TC_NEW_TOP_LINE = 1.
ELSE.
*&SPWIZARD: no, ... *
CALL FUNCTION 'SCROLLING_IN_TABLE'
EXPORTING
ENTRY_ACT = <TC>-TOP_LINE
ENTRY_FROM = 1
ENTRY_TO = <TC>-LINES
LAST_PAGE_FULL = 'X'
LOOPS = <LINES>
OK_CODE = P_OK
OVERLAPPING = 'X'
IMPORTING
ENTRY_NEW = L_TC_NEW_TOP_LINE
EXCEPTIONS
NO_ENTRY_OR_PAGE_ACT = 01
NO_ENTRY_TO = 02
NO_OK_CODE_OR_PAGE_GO = 03
OTHERS = 0.
ENDIF.
*&SPWIZARD: get actual tc and column *
GET CURSOR FIELD L_TC_FIELD_NAME
AREA L_TC_NAME.
IF SYST-SUBRC = 0.
IF L_TC_NAME = P_TC_NAME.
*&SPWIZARD: et actual column *
SET CURSOR FIELD L_TC_FIELD_NAME LINE 1.
ENDIF.
ENDIF.
*&SPWIZARD: set the new top line *
<TC>-TOP_LINE = L_TC_NEW_TOP_LINE.
ENDFORM. " COMPUTE_SCROLLING_IN_TC
*& Form FCODE_TC_MARK_LINES
marks all TableControl lines
-->P_TC_NAME name of tablecontrol
FORM FCODE_TC_MARK_LINES USING P_TC_NAME
P_TABLE_NAME
P_MARK_NAME.
&SPWIZARD: EGIN OF LOCAL DATA----
DATA L_TABLE_NAME LIKE FELD-NAME.
FIELD-SYMBOLS <TC> TYPE cxtab_control.
FIELD-SYMBOLS <TABLE> TYPE STANDARD TABLE.
FIELD-SYMBOLS <WA>.
FIELD-SYMBOLS <MARK_FIELD>.
&SPWIZARD: END OF LOCAL DATA----
ASSIGN (P_TC_NAME) TO <TC>.
*&SPWIZARD: get the table, which belongs to the tc *
CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
ASSIGN (L_TABLE_NAME) TO <TABLE>. "not headerline
*&SPWIZARD: mark all filled lines *
LOOP AT <TABLE> ASSIGNING <WA>.
*&SPWIZARD: access to the component 'FLAG' of the table header *
ASSIGN COMPONENT P_MARK_NAME OF STRUCTURE <WA> TO <MARK_FIELD>.
<MARK_FIELD> = 'X'.
ENDLOOP.
ENDFORM. "fcode_tc_mark_lines
*& Form FCODE_TC_DEMARK_LINES
demarks all TableControl lines
-->P_TC_NAME name of tablecontrol
FORM FCODE_TC_DEMARK_LINES USING P_TC_NAME
P_TABLE_NAME
P_MARK_NAME .
&SPWIZARD: BEGIN OF LOCAL DATA----
DATA L_TABLE_NAME LIKE FELD-NAME.
FIELD-SYMBOLS <TC> TYPE cxtab_control.
FIELD-SYMBOLS <TABLE> TYPE STANDARD TABLE.
FIELD-SYMBOLS <WA>.
FIELD-SYMBOLS <MARK_FIELD>.
&SPWIZARD: END OF LOCAL DATA----
ASSIGN (P_TC_NAME) TO <TC>.
*&SPWIZARD: get the table, which belongs to the tc *
CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
ASSIGN (L_TABLE_NAME) TO <TABLE>. "not headerline
*&SPWIZARD: demark all filled lines *
LOOP AT <TABLE> ASSIGNING <WA>.
*&SPWIZARD: access to the component 'FLAG' of the table header *
ASSIGN COMPONENT P_MARK_NAME OF STRUCTURE <WA> TO <MARK_FIELD>.
<MARK_FIELD> = SPACE.
ENDLOOP.
ENDFORM. "fcode_tc_mark_lines
Source : https://forums.sdn.sap.com/click.jspa?searchID=15092700&messageID=5654151
Have A Good Day
Chaitanya. -
Calling a report from module pool program
Hi all,
I had a requirement where I need to call a report from the module pool program where in when we click REPORT button, it should display the report output in the another screen.
Can we do by calling screen after pushing REPORT button. If so, where we should write that code ( In pbo or pai). Please give me an idea.
Thanking you,
Regards,
Murali Krishna TUse submit syntax.
Press F1 on submit, Donot use return statement with it.
If so, where we should write that code ( In pbo or pai).
Please understand about these two events before doing the requirement. -
How to make a fld mandatory in module pool program?
I need help on following 2 things
I have module pool program created, in that many screen subscreens created.
1.I want to make a field mandatory
second one is, I have a general tab and data tab.
General tab screen - 2101
Data tab = 2102
In general tab, I have edited the values (change mode), when change the values and try to save it,
It is holding old value.but If i exucute the transaction once again, it is showing the changed value(new value)
For ex: there is a date field value is 03/08/2009
If I change this to 03/09/2009 and press on Save button from the standard menu, still it is showing the value 03/08/2009. but I execute this transaction once again it is showing the value as 03/09/2009
I will be thankful if someone helps me hereHi Chitra,
Go to the properties of the filed select program tab and say input required.
then you will get the problem solved.
For second one actually its saving but not displaying the saved value at the same time ,
for this you write the select statement after saving , so that once save is execute m, select statement also will execute and it will display the newly saved value.
so after saving imdeatly u write the select statement.
like case sy-ucomm.
when 'SAVE'.
insert ztable.
select filed from z table.
endcase.
let me know if ur problem solved.
Regards
Rajendra -
How to use one module pool program in another module pool programming?
Hi
I have one moodule pool program.
In one of my screen i want to use some code which already developed in another module pool program.
Is there any direct way for using one module pool programcode in another module pool program.
If there any approaches for this plz help me in this issue.Dear,
If you want to use the code.
first you can write your code in a subroutine in module pool program 1
and then you can use it from module pool program 2 by
perform subroutine_name(program_name)
using P_1
changing C_1
if you wan to use one module pool data into other module pool.
so that is another requirement. -
How to take backup of an entire module pool program with code,screen,etc.
Hi experts,
I have some important data in the ides server for which i want to take backup of them.
I have some question regarding the same.
1.How to take backup/download of an entire module pool program with code,screen,etc.
2.How can we take backup/download for a DB table with its structure?
3.How can we take backup of a search help?
Please give some suggestions abt the same.
Regards,
Ashesh.Hi,
May be just for viewing, try downloading from SE80 transaction from the others option.
Here just try issuing the print, it will generate the spool.
Now using the spool, download to your desktop as required. It will have all the information regarding the attributes, fields, elements everything.
The only issue is, may be you need to take all the screens separately.
Regards,
Santhosh. -
How to change the logon language in module pool program?
Hello All,
I had created a module pool program and had desiged a screen.
When i am logged in English language i am able to see them in english as per the requirement it is working fine.
But the requirement is wen i am logged in DE then the selection-screen texts should show in English and not in German.
Kindly give me a solution for this.
Thanks & Regards,
Rajesh KumarHi Rajesh,
This problem is because you have maintained a standard dictionary fields on selection screen and all the standard dictionary fields are maintained in DE language, on the screen layout, go to the attributes of that particular text field, there is a option MODIFIZ for dictionary fields (it is a drop down), selection F TEXT, now whatever the text u will define, it will remain same for all the languages, once u do this then u again login in DE,l u will see the text maintained by u and not the DE text.
Do reply if problem still persist.
point if useful.
Rohit G
Edited by: Rohit Gaharwar on Aug 11, 2009 1:24 PM
Edited by: Rohit Gaharwar on Aug 11, 2009 1:30 PM
Edited by: Rohit Gaharwar on Aug 11, 2009 1:36 PM
Edited by: Rohit Gaharwar on Aug 11, 2009 1:36 PM
Edited by: Rohit Gaharwar on Aug 11, 2009 1:37 PM
Edited by: Rohit Gaharwar on Aug 11, 2009 1:38 PM -
In module pool program - i want to control size of screen.
Hi,
In module pool program , I am handling 2 screen . while calling the 2 nd screen , i want to display the window size as i required.
Plz help me.
Regards,
Rani.Hi,
Specify the positions as
CALL SCREEN dynnr
[STARTING AT col1 lin1
[ENDING AT col2 lin2]].
By default, the screens of all dynpros of the called dynpro sequence are displayed in the current window. Use addition STARTING AT to open a modal dialog window.
Addition
... STARTING AT col1 lin1 [ENDING AT col2 lin2]
Effect
Use addition STARTING AT to open a new popup level and to display all screens of the called dynpro sequence in a modal dialog window. The upper left corner of the dialog window is determined by the values col1 and lin1 for column and line. The values refer to the window with popup level 0. The lower right corner is set automatically or you can use col2 and lin2 to specify it after ENDING AT. For col1, lin1, col2 and lin2, data objects of type i are expected. The values of col1, lin1 should be smaller than those of col2, lin2, because otherwise the behavior is undefined. The maximum popup level is 9.
Pls reward points if solved your issue.
Regards,
Renjith Michael. -
How to Use F4 help in Module Pool Programming??????
Hi Friends,
This is Jagadeesh, I have an issue Module Pool Programming. Any of you can go through on this and can give an required answer.
Issue is as follows,
I have an Input/Output field for that i need to give f4 help, based on that field the related data should sit in to my table control. The thing is there is no relation between the input/output field and the table control fields.
Is this possible? If so how can i do this.Hi Jagadeesh,
For F4 Values on Screen:
PROCESS ON VALUE_REQUEST
using module call starting with FIELD i.e FIELD field MODULE module
There are number of function modules that can be used for the purpose, but these
can fullfill the task easily or combination of them.
DYNP_VALUE_READ
F4IF_FIELD_VALUE_REQUEST
F4IF_INT_TABLE_VALUE_REQUEST
POPUP_WITH_TABLE_DISPLAY
DYNP_VALUE_READ
This function module is used to read values in the screen fields. Use of this
FM causes forced transfer of data from screen fields to ABAP fields.
There are 3 exporting parameters
DYNAME = program name = SY-CPROG
DYNUMB = Screen number = SY-DYNNR
TRANSLATE_TO_UPPER = 'X'
and one importing TABLE parameter
DYNPFIELDS = Table of TYPE DYNPREAD
The DYNPFIELDS parameter is used to pass internal table of type DYNPREAD
to this FM and the values read from the screen will be stored in this table.This
table consists of two fields:
FIELDNAME : Used to pass the name of screen field for which the value is to
be read.
FIELDVALUE : Used to read the value of the field in the screen.
e.g.
DATA: SCREEN_VALUES TYPE TABLE OF DYNPREAD ,
SCREEN_VALUE LIKE LINE OF SCREEN_VALUES.
SCREEN_VALUE-FIELDNAME = 'KUNNR' . * Field to be read
APPEND SCREEN_VALUE TO SCREEN_VALUES. * Fill the table
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = SY-CPROG
DYNUMB = SY-DYNNR
TRANSLATE_TO_UPPER = 'X'
TABLES
DYNPFIELDS = SCREEN_VALUES.
READ TABLE SCREEN_VALUES INDEX 1 INTO SCREEN_VALUE.Now the screen value for field KUNNR is in the SCREEN_VALUE-FIELDVALUE and can be used for further processing like using it to fill the internal table to be used as parameter in F4IF_INT_TABLE_VALUE_REQUEST ETC.
F4IF_FIELD_VALUE_REQUEST
This FM is used to display value help or input from ABAP dictionary.We have to pass the name of the structure or table(TABNAME) along with the field name(FIELDNAME) . The selection can be returned to the specified screen field if three
parameters DYNPNR,DYNPPROG,DYNPROFIELD are also specified or to a table if RETRN_TAB is specified.
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
TABNAME = table/structure
FIELDNAME = 'field name'
DYNPPROG = SY-CPROG
DYNPNR = SY-DYNR
DYNPROFIELD = 'screen field'
IMPORTING
RETURN_TAB = table of type DYNPREAD
F4IF_INT_TABLE_VALUE_REQUEST
This FM is used to dsiplay values stored in an internal table as input
help.This FM is used to program our own custom help if no such input help
exists in ABAP dictionary for a particular field. The parameter VALUE_TAB is used to pass the internal table containing input values.The parameter RETFIELD
is used to specify the internal table field whose value will be returned to the screen field or RETURN_TAB.
If DYNPNR,DYNPPROG and DYNPROFIELD are specified than the user selection is passed to the screen field specified in the DYNPROFIELD. If RETURN_TAB is specified the selectionis returned in a table.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = field from int table whose value will be returned
DYNPPROG = SY-CPROG
DYNPNR = SY-DYNNR
DYNPROFIELD = 'screen field'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = internal table whose values will be shown.
RETURN_TAB = internal table of type DDSHRETVAL
EXCEPTIONS
parameter_error = 1
no_values_found = 2
others = 3.
POPUP_WITH_TABLE_DISPLAY
This FM is used to display the contents of an internal table in a popup window.The user can select a row and the index of that is returned in the CHOISE
parameter.The VALUETAB is used to pass the internal table.
A suitable title can be set using TITLETEXT parameter. The starting and end position of the popup can be specified by the parameters STARTPOS_COL / ROW and ENDPOS_ROW / COL .
CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'
EXPORTING
ENDPOS_COL =
ENDPOS_ROW =
STARTPOS_COL =
STARTPOS_ROW =
TITLETEXT = 'title text'
IMPORTING
CHOISE =
TABLES
VALUETAB =
EXCEPTIONS
BREAK_OFF = 1
OTHERS = 2.
e.g.
DATA: w_choice TYPE SY-TABIX.
DATA: BEGIN OF i_values OCCURS 0 WITH HEADER LINE,
values TYPE I,
END OF i_values.
PARAMETRS : id TYPE I.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR id
i_values-values = '0001'.
APPEND i_values.
i_values-values = '0002'.
APPEND i_values.
i_values-values = '0003'.
APPEND i_values.
i_values-values = '0004'.
APPEND i_values.
CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'
EXPORTING
ENDPOS_COL = 40
ENDPOS_ROW = 12
STARTPOS_COL = 20
STARTPOS_ROW = 5
TITLETEXT = 'Select an ID'
IMPORTING
CHOISE = w_choice
TABLES
VALUETAB = i_values
EXCEPTIONS
BREAK_OFF = 1
OTHERS = 2.
CHECK w_choice > 0.
READ TABLE i_values INDEX w_choice....now we can process the selection as it is contained
...in the structure i_values.
Other FM that may be used to provide input help is HELP_START .
regards,
Dj
reward for all useful answers. -
Module Pool Programming using Abap Objects
Hi gurus.,
I need to create a module pool program with tabstrips and tablecontrols using Abap objects...plz guide me how i can achieve this... i am very much confused.. i dont know how and where to start .. plz send me documents and sample codes related to this topic..Also hoe i can implement f4 help in screen fields.. plz help me with Sample Code....
Regards.,
S.SivakumarHi Marcelo Ramos.,
here is my code without using WebLOg ..
PROGRAM ZACR018_BOXKOD .
TABLES DECLARATION
TABLES: ZACT02_BOXKOD, ZACS018_STR, MARA.
CONTROLS TABC TYPE TABLEVIEW USING SCREEN 102.
END OF TABLES DECLARATION
DEFINE DYN_DECLARE_CREATE.
DATA: &1 TYPE REF TO &2.
CREATE OBJECT &1.
END-OF-DEFINITION.
CONSTANTS C_WERKS TYPE WERKS_D VALUE '7600'.
CONSTANTS C_REPID TYPE SY-REPID VALUE SY-REPID.
CONSTANTS C_VERID TYPE VERID VALUE '0001'.
CONSTANTS C_MDV01 TYPE MDV01 VALUE 'F3LB02'.
CLASS CL_TABLE_CONTROL DEFINITION.
PUBLIC SECTION.
CLASS-DATA: IT_C_DISPLAY TYPE STANDARD TABLE OF ZACS018_STR.
CLASS-DATA: WA_DISPLAY TYPE ZACS018_STR.
CLASS-DATA: WA_COLS LIKE LINE OF TABC-COLS.
CLASS-METHODS M1 IMPORTING WA_C_DISPLAY TYPE ZACS018_STR EXPORTING ZACS018_STR_C TYPE ZACS018_STR.
CLASS-METHODS M2 IMPORTING ZACS018_STR_C TYPE ZACS018_STR CHANGING IT_C_DISPLAY LIKE IT_C_DISPLAY.
CLASS-METHODS M3 IMPORTING SAVE_OK TYPE SY-UCOMM CHANGING C_TABC TYPE CX_TABLEVIEW.
CLASS-METHODS M4 IMPORTING MASTER_PATTERN TYPE ZACT02_BOXKOD-MASTER_PATTERN
PATTERNSLNO TYPE ZACT02_BOXKOD-PATTERNSLNO
SAVE_OK TYPE SY-UCOMM
CHANGING C_TABC TYPE CX_TABLEVIEW.
ENDCLASS.
CLASS CL_TABLE_CONTROL IMPLEMENTATION.
METHOD M1.
ZACS018_STR_C = WA_C_DISPLAY.
ENDMETHOD.
METHOD M2.
DESCRIBE TABLE IT_C_DISPLAY.
IF TABC-CURRENT_LINE > SY-TFILL.
APPEND ZACS018_STR_C TO IT_C_DISPLAY.
ELSE.
MODIFY IT_C_DISPLAY FROM ZACS018_STR_C INDEX TABC-CURRENT_LINE.
ENDIF.
ENDMETHOD.
METHOD M3.
IF SAVE_OK = 'CHECK'.
LOOP AT C_TABC-COLS INTO WA_COLS.
IF WA_COLS-SCREEN-GROUP2 = 'BOT'.
WA_COLS-SCREEN-INPUT = 0.
MODIFY C_TABC-COLS FROM WA_COLS INDEX SY-TABIX.
ENDIF.
ENDLOOP.
ELSE.
LOOP AT C_TABC-COLS INTO WA_COLS.
IF WA_COLS-SCREEN-GROUP2 = 'BOT'.
WA_COLS-SCREEN-INPUT = 1.
MODIFY C_TABC-COLS FROM WA_COLS INDEX SY-TABIX.
ENDIF.
ENDLOOP.
ENDIF.
ENDMETHOD.
METHOD M4.
IF MASTER_PATTERN IS INITIAL OR PATTERNSLNO IS INITIAL.
LOOP AT C_TABC-COLS INTO WA_COLS.
IF WA_COLS-SCREEN-GROUP2 = 'BOT'.
WA_COLS-SCREEN-INPUT = 0.
MODIFY C_TABC-COLS FROM WA_COLS INDEX SY-TABIX.
ENDIF.
ENDLOOP.
ELSE.
IF SAVE_OK NE 'CHECK'.
LOOP AT C_TABC-COLS INTO WA_COLS.
IF WA_COLS-SCREEN-GROUP2 = 'BOT'.
WA_COLS-SCREEN-INPUT = 1.
MODIFY C_TABC-COLS FROM WA_COLS INDEX SY-TABIX.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
ENDMETHOD.
ENDCLASS.
INTERFACE I_DATA.
DATA: WA_MARA TYPE MARA.
DATA: WA_MARC TYPE MARC.
DATA: WA_MAST TYPE MAST.
DATA: WA_STKO TYPE STKO.
DATA: WA_MKAL TYPE MKAL.
DATA: IT_STPOX TYPE STANDARD TABLE OF STPOX.
DATA: WA_STPOX TYPE STPOX.
DATA: WA_ZACT02_BOXKOD TYPE ZACT02_BOXKOD.
DATA: IT_C_DISPLAY TYPE STANDARD TABLE OF ZACS018_STR.
DATA: IT_SORT_DISPLAY TYPE STANDARD TABLE OF ZACS018_STR.
DATA: WA_DISPLAY TYPE ZACS018_STR.
DATA: W_YIELD(5) TYPE P DECIMALS 2.
METHODS PARTNO_VAL IMPORTING PARTCODE TYPE ZACS018_STR-PARTCODE.
METHODS MAINBI_VAL IMPORTING MAINB TYPE ZACS018_STR-MAINB.
METHODS CAVITY_VAL IMPORTING CAVITY TYPE ZACS018_STR-CAVITY.
METHODS GET_COMP_WT IMPORTING PARTCODE TYPE ZACS018_STR-PARTCODE EXPORTING GROSSWT TYPE ZACS018_STR-GROSSWT.
METHODS NETWT_VAL IMPORTING NETWT TYPE ZACS018_STR-NETWT GROSSWT TYPE ZACS018_STR-GROSSWT.
METHODS MASPAT_VAL IMPORTING MASTER_PATTERN TYPE ZACT02_BOXKOD-MASTER_PATTERN.
METHODS PATSLNO_VAL IMPORTING PATTERNSLNO TYPE ZACT02_BOXKOD-PATTERNSLNO
MASTER_PATTERN TYPE ZACT02_BOXKOD-MASTER_PATTERN .
METHODS MAX_REF EXPORTING VERSNO TYPE ZACT02_BOXKOD-VERSNO.
METHODS NOOFBOX_VAL IMPORTING BMSCH TYPE ZACT02_BOXKOD-BMSCH.
METHODS TOTTIME_VAL IMPORTING VGW01 TYPE ZACT02_BOXKOD-VGW01.
METHODS TOTRUNWT IMPORTING IT_C_DISPLAY LIKE IT_C_DISPLAY
EXPORTING W_SUM_RUNWT LIKE ZACS018_STR-NETWT.
METHODS TOTCOMP_WT IMPORTING IT_C_DISPLAY LIKE IT_C_DISPLAY
EXPORTING W_SUM_COMPWT LIKE ZACS018_STR-NETWT.
METHODS CHECK_OK IMPORTING SAVE_OK TYPE SY-UCOMM.
METHODS SCREEN_DISPLAY IMPORTING MASTER_PATTERN TYPE ZACT02_BOXKOD-MASTER_PATTERN
PATTERNSLNO TYPE ZACT02_BOXKOD-PATTERNSLNO
SAVE_OK TYPE SY-UCOMM.
METHODS DUP_CHECK IMPORTING IT_C_DISPLAY LIKE IT_C_DISPLAY.
METHODS BOX_YLD IMPORTING W_SUM_COMPWT LIKE ZACS018_STR-NETWT
W_TOT_WT LIKE ZACS018_STR-NETWT
EXPORTING W_YIELD LIKE W_YIELD.
ENDINTERFACE.
CLASS CL_CONTROL_EVENTS DEFINITION.
PUBLIC SECTION.
CLASS-DATA: C_WERKS TYPE WERKS_D VALUE C_WERKS.
INTERFACES I_DATA.
ENDCLASS.
CLASS CL_CONTROL_EVENTS IMPLEMENTATION.
METHOD I_DATA~PARTNO_VAL.
SELECT SINGLE * FROM MARA INTO I_DATA~WA_MARA WHERE MATNR = PARTCODE.
IF SY-SUBRC <> 0.
MESSAGE TEXT-001 TYPE 'E'.
ELSE.
IF I_DATA~WA_MARA-MTART NE 'HALB'.
MESSAGE TEXT-002 TYPE 'E'.
ENDIF.
SELECT SINGLE * FROM MARC INTO I_DATA~WA_MARC WHERE MATNR = PARTCODE AND
WERKS = C_WERKS.
IF SY-SUBRC <> 0.
MESSAGE TEXT-003 TYPE 'E'.
ELSE.
IF I_DATA~WA_MARC-FEVOR NE 'KOD'.
MESSAGE TEXT-004 TYPE 'E'.
ENDIF.
ENDIF.
ENDIF.
SELECT SINGLE * FROM MKAL INTO I_DATA~WA_MKAL WHERE MATNR = PARTCODE AND
WERKS = C_WERKS AND
VERID = C_VERID AND
MDV01 = C_MDV01.
IF SY-SUBRC <> 0.
MESSAGE TEXT-028 TYPE 'E'.
ENDIF.
ENDMETHOD.
METHOD I_DATA~CAVITY_VAL.
SET CURSOR FIELD 'ZACS018_STR-CAVITY' LINE SY-STEPL.
IF CAVITY IS INITIAL.
MESSAGE TEXT-005 TYPE 'E'.
ENDIF.
ENDMETHOD.
METHOD I_DATA~MAINBI_VAL.
SET CURSOR FIELD 'ZACS018_STR-MAINB' LINE SY-STEPL.
IF MAINB IS INITIAL.
MESSAGE TEXT-006 TYPE 'E'.
ENDIF.
ENDMETHOD.
METHOD I_DATA~GET_COMP_WT.
SET CURSOR FIELD 'ZACS018_STR-PARTCODE' LINE SY-STEPL.
*SELECT SINGLE MAST~MATNR
MAST~WERKS
MAST~STLAL
STKO~DATUV
INTO (I_DATAWA_MAST-MATNR,I_DATAWA_MAST-WERKS,I_DATAWA_MAST-STLAL,I_DATAWA_STKO-DATUV)
FROM MAST AS MAST INNER JOIN STKO AS STKO
ON STKOSTLNR = MASTSTLNR AND STKOSTLAL = MASTSTLAL
WHERE MAST~MATNR = PARTCODE AND
STKO~STLST = '1' AND
STKO~STLTY = 'M' AND
STKO~LKENZ = '' AND
STKO~LOEKZ = ''.
SELECT SINGLE * FROM MAST INTO I_DATA~WA_MAST WHERE MATNR = PARTCODE AND
STLAN = '1' AND
STLAL = '01' AND
WERKS = C_WERKS.
IF SY-SUBRC <> 0.
MESSAGE TEXT-009 TYPE 'E'.
ENDIF.
*CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
PERCENTAGE = 50
TEXT = TEXT-007.
*WAIT UP TO 2 SECONDS.
REFRESH I_DATA~IT_STPOX.
CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
EXPORTING
FTREL = 'X'
ALEKZ = ' '
ALTVO = ' '
AUFSW = ' '
AUMGB = ' '
AUMNG = 0
AUSKZ = 'X'
AMIND = ' '
BAGRP = ' '
BEIKZ = ' '
BESSL = ' '
BGIXO = 'X'
BREMS = 'X'
CAPID = 'PP01'
CHLST = ' '
COSPR = ' '
CUOBJ = 000000000000000
CUOVS = 0
CUOLS = ' '
DATUV = SY-DATUM
DELNL = SPACE
DRLDT = ' '
EHNDL = '1'
EMENG = 0
ERSKZ = ' '
ERSSL = ' '
FBSTP = ' '
KNFBA = ' '
KSBVO = ' '
MBWLS = ' '
MKTLS = 'X'
MDMPS = ' '
MEHRS = ' '
MKMAT = ' '
MMAPS = ' '
SALWW = ' '
SPLWW = ' '
MMORY = '0'
MTNRV = PARTCODE
NLINK = ' '
POSTP = ' '
RNDKZ = ' '
RVREL = ' '
SANFR = ' '
SANIN = ' '
SANKA = ' '
SANKO = ' '
SANVS = ' '
SCHGT = ' '
STKKZ = ' '
STLAL = '01'
STLAN = '1'
STPST = 0
SVWVO = 'X'
WERKS = C_WERKS
NORVL = ' '
MDNOT = ' '
PANOT = ' '
QVERW = ' '
VERID = ' '
VRSVO = 'X'
IMPORTING
TOPMAT =
DSTST =
TABLES
STB = I_DATA~IT_STPOX
MATCAT =
EXCEPTIONS
ALT_NOT_FOUND = 1
CALL_INVALID = 2
MATERIAL_NOT_FOUND = 3
MISSING_AUTHORIZATION = 4
NO_BOM_FOUND = 5
NO_PLANT_DATA = 6
NO_SUITABLE_BOM_FOUND = 7
CONVERSION_ERROR = 8
OTHERS = 9
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 AT I_DATA~IT_STPOX INTO I_DATA~WA_STPOX.
SELECT SINGLE FEVOR FROM MARC INTO I_DATA~WA_MARC-FEVOR WHERE MATNR = I_DATA~WA_STPOX-IDNRK AND
WERKS = I_DATA~WA_STPOX-WERKS AND
FEVOR = 'MLT'.
IF SY-SUBRC EQ 0.
GROSSWT = I_DATA~WA_STPOX-MNGLG.
EXIT.
ELSE.
CLEAR GROSSWT.
ENDIF.
ENDLOOP.
IF GROSSWT IS INITIAL.
MESSAGE TEXT-008 TYPE 'E'.
ENDIF.
ENDMETHOD.
METHOD I_DATA~NETWT_VAL.
SET CURSOR FIELD 'ZACS018_STR-NETWT' LINE SY-STEPL.
IF NETWT IS INITIAL.
MESSAGE TEXT-010 TYPE 'E'.
ELSE.
IF NETWT >= GROSSWT.
MESSAGE TEXT-011 TYPE 'E'.
ENDIF.
ENDIF.
ENDMETHOD.
METHOD I_DATA~MASPAT_VAL.
IF MASTER_PATTERN IS INITIAL.
MESSAGE TEXT-014 TYPE 'E'.
ENDIF.
SELECT SINGLE * FROM MARA INTO I_DATA~WA_MARA WHERE MATNR = MASTER_PATTERN.
IF SY-SUBRC <> 0.
MESSAGE TEXT-001 TYPE 'E'.
ELSE.
IF I_DATA~WA_MARA-MTART NE 'FHMI'.
MESSAGE TEXT-012 TYPE 'E'.
ENDIF.
SELECT SINGLE * FROM MARC INTO I_DATA~WA_MARC WHERE MATNR = MASTER_PATTERN AND
WERKS = C_WERKS.
IF SY-SUBRC <> 0.
MESSAGE TEXT-003 TYPE 'E'.
ELSE.
IF I_DATA~WA_MARC-FEVOR NE 'MLD'.
MESSAGE TEXT-013 TYPE 'E'.
ENDIF.
ENDIF.
ENDIF.
ENDMETHOD.
METHOD I_DATA~PATSLNO_VAL.
IF PATTERNSLNO IS INITIAL.
MESSAGE TEXT-016 TYPE 'E'.
ENDIF.
SELECT SINGLE * FROM ZACT02_BOXKOD INTO I_DATA~WA_ZACT02_BOXKOD WHERE MASTER_PATTERN = MASTER_PATTERN
AND PATTERNSLNO = PATTERNSLNO.
IF SY-SUBRC EQ 0.
MESSAGE TEXT-015 TYPE 'E'.
ENDIF.
ENDMETHOD.
METHOD I_DATA~MAX_REF.
SELECT SINGLE MAX( VERSNO ) FROM ZACT02_BOXKOD INTO VERSNO.
VERSNO = VERSNO + 1.
ENDMETHOD.
METHOD I_DATA~NOOFBOX_VAL.
IF BMSCH IS INITIAL.
LOOP AT SCREEN.
IF SCREEN-GROUP2 = 'BOT' AND SCREEN-NAME <> 'ZACT02_BOXKOD-PRD_ACT' AND SCREEN-NAME <> 'ZACT02_BOXKOD-SHOTS'.
SCREEN-INPUT = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
MESSAGE TEXT-017 TYPE 'E'.
ENDIF.
ENDMETHOD.
METHOD I_DATA~TOTTIME_VAL.
IF VGW01 IS INITIAL.
MESSAGE TEXT-018 TYPE 'E'.
ENDIF.
IF VGW01 > 480.
MESSAGE TEXT-019 TYPE 'E'.
ENDIF.
ENDMETHOD.
METHOD I_DATA~TOTRUNWT.
CLEAR W_SUM_RUNWT.
LOOP AT IT_C_DISPLAY INTO I_DATA~WA_DISPLAY.
W_SUM_RUNWT = W_SUM_RUNWT + I_DATA~WA_DISPLAY-NETWT * I_DATA~WA_DISPLAY-CAVITY.
ENDLOOP.
ENDMETHOD.
METHOD I_DATA~TOTCOMP_WT.
CLEAR W_SUM_COMPWT.
LOOP AT IT_C_DISPLAY INTO I_DATA~WA_DISPLAY.
W_SUM_COMPWT = W_SUM_COMPWT + I_DATA~WA_DISPLAY-GROSSWT * I_DATA~WA_DISPLAY-CAVITY.
ENDLOOP.
ENDMETHOD.
METHOD I_DATA~CHECK_OK.
IF SAVE_OK = 'CHECK'.
LOOP AT SCREEN.
IF SCREEN-GROUP2 = 'BOT'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSE.
LOOP AT SCREEN.
IF SCREEN-GROUP2 = 'BOT'.
SCREEN-INPUT = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDMETHOD.
METHOD I_DATA~SCREEN_DISPLAY.
IF MASTER_PATTERN IS INITIAL
OR PATTERNSLNO IS INITIAL.
LOOP AT SCREEN.
IF SCREEN-GROUP2 = 'BOT'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSE.
IF SAVE_OK NE 'CHECK'.
LOOP AT SCREEN.
IF SCREEN-GROUP2 = 'BOT'.
SCREEN-INPUT = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
ENDMETHOD.
METHOD I_DATA~DUP_CHECK. " IMPORTING IT_C_DISPLAY
DATA: W_PARTCODE LIKE I_DATA~WA_DISPLAY-PARTCODE.
I_DATA~IT_SORT_DISPLAY = IT_C_DISPLAY.
SORT I_DATA~IT_SORT_DISPLAY BY PARTCODE.
CLEAR W_PARTCODE.
LOOP AT I_DATA~IT_SORT_DISPLAY INTO I_DATA~WA_DISPLAY.
IF W_PARTCODE = I_DATA~WA_DISPLAY-PARTCODE.
MESSAGE TEXT-027 TYPE 'E'.
ENDIF.
W_PARTCODE = I_DATA~WA_DISPLAY-PARTCODE.
ENDLOOP.
ENDMETHOD.
METHOD I_DATA~BOX_YLD.
W_YIELD = ( W_SUM_COMPWT / W_TOT_WT ) * 100.
ENDMETHOD.
ENDCLASS.
inherited class for edit mode
CLASS CL_CONTROL_EDIT DEFINITION INHERITING FROM CL_CONTROL_EVENTS .
PUBLIC SECTION.
METHODS GET_DATA IMPORTING MASTER_PATTERN TYPE ZACT02_BOXKOD-MASTER_PATTERN
PATTERNSLNO TYPE ZACT02_BOXKOD-PATTERNSLNO
EXPORTING VERSNO TYPE ZACT02_BOXKOD-VERSNO
CHANGING ZACT02_BOXKOD TYPE ZACT02_BOXKOD
IT_C_DISPLAY LIKE I_DATA~IT_C_DISPLAY
IT_DEL_DISPLAY LIKE I_DATA~IT_C_DISPLAY
TABC TYPE CX_TABLEVIEW.
METHODS PATSLNO_VAL_CHG IMPORTING PATTERNSLNO TYPE ZACT02_BOXKOD-PATTERNSLNO
MASTER_PATTERN TYPE ZACT02_BOXKOD-MASTER_PATTERN .
ENDCLASS.
CLASS CL_CONTROL_EDIT IMPLEMENTATION.
METHOD GET_DATA.
IF MASTER_PATTERN IS NOT INITIAL AND PATTERNSLNO IS NOT INITIAL.
IF IT_C_DISPLAY IS INITIAL.
IF IT_DEL_DISPLAY IS INITIAL.
SELECT SINGLE MAX( VERSNO ) FROM ZACT02_BOXKOD INTO VERSNO WHERE
MASTER_PATTERN = MASTER_PATTERN AND
PATTERNSLNO = PATTERNSLNO.
SELECT SINGLE * FROM ZACT02_BOXKOD INTO ZACT02_BOXKOD WHERE
MASTER_PATTERN = MASTER_PATTERN AND
PATTERNSLNO = PATTERNSLNO AND
VERSNO = VERSNO..
SELECT PARTCODE MAINB CAVITY GROSSWT NETWT FROM ZACT02_BOXKOD INTO
CORRESPONDING FIELDS OF TABLE IT_C_DISPLAY WHERE
MASTER_PATTERN = MASTER_PATTERN AND
PATTERNSLNO = PATTERNSLNO AND
VERSNO = VERSNO.
IT_DEL_DISPLAY[] = IT_C_DISPLAY[].
DESCRIBE TABLE IT_C_DISPLAY.
TABC-LINES = SY-TFILL.
ENDIF.
ENDIF.
ENDIF.
ENDMETHOD.
METHOD PATSLNO_VAL_CHG.
SELECT SINGLE * FROM ZACT02_BOXKOD INTO I_DATA~WA_ZACT02_BOXKOD WHERE MASTER_PATTERN = MASTER_PATTERN
AND PATTERNSLNO = PATTERNSLNO.
IF PATTERNSLNO IS INITIAL.
MESSAGE TEXT-016 TYPE 'E'.
ENDIF.
IF SY-SUBRC <> 0.
MESSAGE TEXT-022 TYPE 'E'.
ENDIF.
ENDMETHOD.
ENDCLASS.
inheriting for display
CLASS CL_CONTROL_DISPLAY DEFINITION INHERITING FROM CL_CONTROL_EDIT .
PUBLIC SECTION.
METHODS GET_DISPLAY_DATA IMPORTING MASTER_PATTERN TYPE ZACT02_BOXKOD-MASTER_PATTERN
PATTERNSLNO TYPE ZACT02_BOXKOD-PATTERNSLNO
VERSNO TYPE ZACT02_BOXKOD-VERSNO
CHANGING IT_C_DISPLAY LIKE I_DATA~IT_C_DISPLAY
ZACT02_BOXKOD TYPE ZACT02_BOXKOD
TABC TYPE CX_TABLEVIEW.
ENDCLASS.
CLASS CL_CONTROL_DISPLAY IMPLEMENTATION.
METHOD GET_DISPLAY_DATA.
SELECT SINGLE * FROM ZACT02_BOXKOD INTO ZACT02_BOXKOD WHERE
MASTER_PATTERN = MASTER_PATTERN AND
PATTERNSLNO = PATTERNSLNO AND
VERSNO = VERSNO..
IF SY-SUBRC <> 0.
MESSAGE TEXT-026 TYPE 'E'.
ENDIF.
SELECT PARTCODE MAINB CAVITY GROSSWT NETWT FROM ZACT02_BOXKOD INTO
CORRESPONDING FIELDS OF TABLE IT_C_DISPLAY WHERE
MASTER_PATTERN = MASTER_PATTERN AND
PATTERNSLNO = PATTERNSLNO AND
VERSNO = VERSNO.
DESCRIBE TABLE IT_C_DISPLAY.
TABC-LINES = SY-TFILL.
ENDMETHOD.
ENDCLASS.
DATA: O_CONTROL_EVENTS TYPE REF TO CL_CONTROL_EVENTS.
DATA: O_CONTROL_EVENTS_EDIT TYPE REF TO CL_CONTROL_EDIT.
DATA: O_CONTROL_EVENTS_DISPLAY TYPE REF TO CL_CONTROL_DISPLAY.
SELECTION SCREEN
END OF SELECTION SCREEN
VARIABLE DECLARATION BEGIN WITH W_
DATA: OK_CODE TYPE SY-UCOMM,
SAVE_OK TYPE SY-UCOMM.
DATA: W_TOT_WT LIKE ZACS018_STR-NETWT,
W_SUM_COMPWT LIKE ZACS018_STR-NETWT,
W_SUM_RUNWT LIKE ZACS018_STR-NETWT,
W_YIELD(5) TYPE P DECIMALS 2.
DATA: W_TIMLO TYPE SY-TIMLO,
W_MODE TYPE SY-UCOMM.
DATA: W_SCREEN_NO TYPE SY-DYNNR.
END OF VARIABLE DECLARATION
WORK AREAS DECLARATION BEGIN WITH WA_
DATA: WA_DISPLAY TYPE ZACS018_STR.
END OF WORK AREAS DECLARATION
INTERNAL TABLES BEGIN WITH IT_
DATA: IT_DISPLAY TYPE ZACS018_STR OCCURS 0.
DATA: IT_DISPLAY_PRD TYPE ZACS018_STR OCCURS 0.
DATA: IT_DEL_DISPLAY TYPE ZACS018_STR OCCURS 0.
DATA: IT_ZACT02_BOXKOD TYPE ZACT02_BOXKOD OCCURS 0 WITH HEADER LINE.
DATA: IT_ZACT02_BOXKOD_DEL TYPE ZACT02_BOXKOD OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF IT_F4MASTERPAT OCCURS 0,
MASTER_PATTERN LIKE ZACT02_BOXKOD-MASTER_PATTERN,
END OF IT_F4MASTERPAT.
DATA: BEGIN OF IT_F4PATSLNO OCCURS 0,
MASTER_PATTERN LIKE ZACT02_BOXKOD-MASTER_PATTERN,
PATTERNSLNO LIKE ZACT02_BOXKOD-PATTERNSLNO,
VERSNO LIKE ZACT02_BOXKOD-VERSNO,
END OF IT_F4PATSLNO.
DATA: IT_EXCLUDE TYPE TABLE OF SY-UCOMM..
DATA : IT_DYNPRO LIKE DYNPREAD OCCURS 0 WITH HEADER LINE.
END OF INTERNAL TABLES DECLARATIONS
LOAD-OF-PROGRAM.
CREATE OBJECT O_CONTROL_EVENTS.
*& Module USER_COMMAND_0100 INPUT
text
MODULE USER_COMMAND_0100 INPUT.
SAVE_OK = OK_CODE.
CLEAR OK_CODE.
W_MODE = SAVE_OK.
CASE SAVE_OK.
WHEN 'CREATE'.
CALL SCREEN 101.
WHEN 'CHANGE'.
CREATE OBJECT O_CONTROL_EVENTS_EDIT.
CALL SCREEN 101.
WHEN 'DISPLAY'.
APPEND 'SAVE' TO IT_EXCLUDE.
APPEND 'CHECK' TO IT_EXCLUDE.
APPEND 'ADD' TO IT_EXCLUDE.
CREATE OBJECT O_CONTROL_EVENTS_DISPLAY.
CALL SCREEN 101.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Module STATUS_0102 OUTPUT
text
MODULE STATUS_0102 OUTPUT.
CALL METHOD CL_TABLE_CONTROL=>M3 EXPORTING SAVE_OK = SAVE_OK CHANGING C_TABC = TABC.
CALL METHOD O_CONTROL_EVENTS->I_DATA~CHECK_OK EXPORTING SAVE_OK = SAVE_OK.
CALL METHOD O_CONTROL_EVENTS->I_DATA~SCREEN_DISPLAY EXPORTING MASTER_PATTERN = ZACT02_BOXKOD-MASTER_PATTERN
PATTERNSLNO = ZACT02_BOXKOD-PATTERNSLNO
SAVE_OK = SAVE_OK.
CALL METHOD CL_TABLE_CONTROL=>M4 EXPORTING MASTER_PATTERN = ZACT02_BOXKOD-MASTER_PATTERN
PATTERNSLNO = ZACT02_BOXKOD-PATTERNSLNO
SAVE_OK = SAVE_OK
CHANGING C_TABC = TABC.
DESCRIBE TABLE IT_DISPLAY.
IF TABC-LINES <= 1.
IF SY-TFILL = 0.
TABC-LINES = 1.
ENDIF.
ENDIF.
IF SAVE_OK NE 'CHECK'.
IF ZACT02_BOXKOD-TOOL_ACT <> 'X'.
CLEAR ZACT02_BOXKOD-PRD_ACT.
LOOP AT SCREEN.
IF SCREEN-NAME = 'ZACT02_BOXKOD-PRD_ACT'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSE.
LOOP AT SCREEN.
IF SCREEN-NAME = 'ZACT02_BOXKOD-PRD_ACT'.
SCREEN-INPUT = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
CALL METHOD O_CONTROL_EVENTS->I_DATA~TOTRUNWT EXPORTING IT_C_DISPLAY = IT_DISPLAY
IMPORTING W_SUM_RUNWT = W_SUM_RUNWT.
CALL METHOD O_CONTROL_EVENTS->I_DATA~TOTCOMP_WT EXPORTING IT_C_DISPLAY = IT_DISPLAY
IMPORTING W_SUM_COMPWT = W_SUM_COMPWT.
CLEAR W_TOT_WT.
W_TOT_WT = W_SUM_RUNWT + W_SUM_COMPWT.
CALL METHOD O_CONTROL_EVENTS->I_DATA~BOX_YLD EXPORTING W_SUM_COMPWT = W_SUM_COMPWT
W_TOT_WT = W_TOT_WT
IMPORTING W_YIELD = W_YIELD.
IF W_MODE <> 'CREATE'.
LOOP AT SCREEN.
IF SCREEN-NAME = 'ZACT02_BOXKOD-SHOTS'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
IF W_MODE = 'DISPLAY'.
LOOP AT SCREEN.
IF SCREEN-NAME = 'ADD' OR SCREEN-NAME = 'ICON_DELETE'.
SCREEN-INPUT = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDMODULE. " STATUS_0102 OUTPUT
*& Module STATUS_0101 OUTPUT
text
MODULE STATUS_0101 OUTPUT.
SET PF-STATUS 'STANDARD' EXCLUDING 'SAVE'.
IF W_MODE = 'CREATE'.
SET TITLEBAR 'STANDARD'.
ELSEIF W_MODE = 'DISPLAY'.
SET TITLEBAR 'STD_DIS'.
ELSE.
SET TITLEBAR 'STD_EDIT'.
ENDIF.
IF SAVE_OK = 'CHECK'.
DESCRIBE TABLE IT_DISPLAY.
IF SY-TFILL > 0.
SET PF-STATUS 'STANDARD'.
ENDIF.
ENDIF.
IF W_MODE = 'DISPLAY'.
SET PF-STATUS 'STANDARD' EXCLUDING IT_EXCLUDE.
ENDIF.
IF ZACT02_BOXKOD-MASTER_PATTERN IS NOT INITIAL AND
ZACT02_BOXKOD-PATTERNSLNO IS NOT INITIAL.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'TOP'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
IF W_MODE = 'DISPLAY'.
IF ZACT02_BOXKOD-VERSNO IS INITIAL.
LOOP AT SCREEN.
IF SCREEN-NAME = 'ZACT02_BOXKOD-VERSNO'.
SCREEN-INPUT = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSE.
LOOP AT SCREEN.
IF SCREEN-NAME = 'ZACT02_BOXKOD-VERSNO'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
ENDMODULE. " STATUS_0101 OUTPUT
*& Module USER_COMMAND_0102 INPUT
text
MODULE USER_COMMAND_0102 INPUT.
SAVE_OK = OK_CODE.
CLEAR OK_CODE.
CASE SAVE_OK.
WHEN 'ADD'.
DESCRIBE TABLE IT_DISPLAY.
IF SY-TFILL >= TABC-LINES.
IF TABC-LINES < 16.
TABC-LINES = SY-TFILL + 1.
ENDIF.
ENDIF.
WHEN 'DEL'.
LOOP AT IT_DISPLAY INTO WA_DISPLAY WHERE MARK = 'X'.
DELETE IT_DISPLAY INDEX SY-TABIX.
ENDLOOP.
DESCRIBE TABLE IT_DISPLAY.
IF SY-TFILL >= 1.
TABC-LINES = SY-TFILL.
ELSE.
TABC-LINES = 1.
ENDIF.
WHEN 'CHECK'.
CALL METHOD O_CONTROL_EVENTS->I_DATA~DUP_CHECK EXPORTING IT_C_DISPLAY = IT_DISPLAY.
WHEN 'SAVE'.
W_TIMLO = SY-TIMLO.
IF W_MODE = 'CREATE'.
PERFORM CREATE_SAVE.
ENDIF.
IF W_MODE = 'CHANGE'.
PERFORM EDIT_SAVE.
ENDIF.
ENDCASE.
IF W_MODE = 'DISPLAY'.
SAVE_OK = 'CHECK'.
ENDIF.
ENDMODULE. " USER_COMMAND_0102 INPUT
*& Module MOD_TABLE INPUT
text
MODULE MOD_TABLE INPUT.
CALL METHOD CL_TABLE_CONTROL=>M2 EXPORTING ZACS018_STR_C = ZACS018_STR CHANGING IT_C_DISPLAY = IT_DISPLAY.
ENDMODULE. " MOD_TABLE INPUT
*& Module ASSIGN OUTPUT
text
MODULE ASSIGN OUTPUT.
CALL METHOD CL_TABLE_CONTROL=>M1 EXPORTING WA_C_DISPLAY = WA_DISPLAY IMPORTING ZACS018_STR_C = ZACS018_STR.
ENDMODULE. " ASSIGN OUTPUT
*& Module CHK_PARTCODE INPUT
text
MODULE CHK_PARTCODE INPUT.
CALL METHOD O_CONTROL_EVENTS->I_DATA~PARTNO_VAL EXPORTING PARTCODE = ZACS018_STR-PARTCODE.
ENDMODULE. " CHK_PARTCODE INPUT
*& Module CHK_CAVITY INPUT
text
MODULE CHK_CAVITY INPUT.
CALL METHOD O_CONTROL_EVENTS->I_DATA~CAVITY_VAL EXPORTING CAVITY = ZACS018_STR-CAVITY.
ENDMODULE. " CHK_CAVITY INPUT
*& Module CHK_MAINB INPUT
text
MODULE CHK_MAINB INPUT.
CALL METHOD O_CONTROL_EVENTS->I_DATA~MAINBI_VAL EXPORTING MAINB = ZACS018_STR-MAINB.
ENDMODULE. " CHK_MAINB INPUT
*& Module GET_COMP_WT INPUT
text
MODULE GET_COMP_WT INPUT.
IF W_MODE <> 'DISPLAY'.
CALL METHOD O_CONTROL_EVENTS->I_DATA~GET_COMP_WT EXPORTING PARTCODE = ZACS018_STR-PARTCODE
IMPORTING GROSSWT = ZACS018_STR-GROSSWT.
ENDIF.
ENDMODULE. " GET_COMP_WT INPUT
*& Module CHK_NETWT INPUT
text
MODULE CHK_NETWT INPUT.
CALL METHOD O_CONTROL_EVENTS->I_DATA~NETWT_VAL EXPORTING NETWT = ZACS018_STR-NETWT
GROSSWT = ZACS018_STR-GROSSWT.
ENDMODULE. " CHK_NETWT INPUT
*& Module CHK_MPAT INPUT
text
MODULE CHK_MPAT INPUT.
CALL METHOD O_CONTROL_EVENTS->I_DATA~MASPAT_VAL EXPORTING MASTER_PATTERN = ZACT02_BOXKOD-MASTER_PATTERN.
ENDMODULE. " CHK_MPAT INPUT
*& Module CHK_SLNO INPUT
text
MODULE CHK_SLNO INPUT.
IF W_MODE = 'CREATE'.
CALL METHOD O_CONTROL_EVENTS->I_DATA~PATSLNO_VAL EXPORTING PATTERNSLNO = ZACT02_BOXKOD-PATTERNSLNO
MASTER_PATTERN = ZACT02_BOXKOD-MASTER_PATTERN .
ELSEIF W_MODE = 'CHANGE' .
CALL METHOD O_CONTROL_EVENTS_EDIT->PATSLNO_VAL_CHG EXPORTING PATTERNSLNO = ZACT02_BOXKOD-PATTERNSLNO
MASTER_PATTERN = ZACT02_BOXKOD-MASTER_PATTERN .
CALL METHOD O_CONTROL_EVENTS_EDIT->GET_DATA EXPORTING MASTER_PATTERN = ZACT02_BOXKOD-MASTER_PATTERN
PATTERNSLNO = ZACT02_BOXKOD-PATTERNSLNO
IMPORTING VERSNO = ZACT02_BOXKOD-VERSNO
CHANGING ZACT02_BOXKOD = ZACT02_BOXKOD
IT_C_DISPLAY = IT_DISPLAY
IT_DEL_DISPLAY = IT_DEL_DISPLAY
TABC = TABC.
ELSE.
CALL METHOD O_CONTROL_EVENTS_DISPLAY->PATSLNO_VAL_CHG EXPORTING PATTERNSLNO = ZACT02_BOXKOD-PATTERNSLNO
MASTER_PATTERN = ZACT02_BOXKOD-MASTER_PATTERN .
ENDIF.
ENDMODULE. " CHK_SLNO INPUT
*& Module MAX_VER INPUT
text
MODULE MAX_VER INPUT.
IF W_MODE = 'CREATE'.
CALL METHOD O_CONTROL_EVENTS->I_DATA~MAX_REF IMPORTING VERSNO = ZACT02_BOXKOD-VERSNO.
ENDIF.
IF W_MODE = 'DISPLAY'.
IF ZACT02_BOXKOD-VERSNO IS INITIAL.
MESSAGE TEXT-023 TYPE 'E'.
ENDIF.
IF ZACT02_BOXKOD-MASTER_PATTERN IS NOT INITIAL AND
ZACT02_BOXKOD-PATTERNSLNO IS NOT INITIAL AND
ZACT02_BOXKOD-VERSNO IS NOT INITIAL.
CALL METHOD O_CONTROL_EVENTS_DISPLAY->GET_DISPLAY_DATA EXPORTING MASTER_PATTERN = ZACT02_BOXKOD-MASTER_PATTERN
PATTERNSLNO = ZACT02_BOXKOD-PATTERNSLNO
VERSNO = ZACT02_BOXKOD-VERSNO
CHANGING ZACT02_BOXKOD = ZACT02_BOXKOD
IT_C_DISPLAY = IT_DISPLAY
TABC = TABC.
ENDIF.
ENDIF.
ENDMODULE. " MAX_VER INPUT
*& Module CHK_NOBOXES INPUT
text
MODULE CHK_NOBOXES INPUT.
CALL METHOD O_CONTROL_EVENTS->I_DATA~NOOFBOX_VAL EXPORTING BMSCH = ZACT02_BOXKOD-BMSCH.
ENDMODULE. " CHK_NOBOXES INPUT
*& Module CHK_TOTTIME INPUT
text
MODULE CHK_TOTTIME INPUT.
CALL METHOD O_CONTROL_EVENTS->I_DATA~TOTTIME_VAL EXPORTING VGW01 = ZACT02_BOXKOD-VGW01.
ENDMODULE. " CHK_TOTTIME INPUT
*& Module STATUS_0100 OUTPUT
text
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'INITIAL'.
SET TITLEBAR 'STANDARD_MAIN'.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module EXIT_PROGRAM INPUT
text
MODULE EXIT_PROGRAM INPUT.
LEAVE TO TRANSACTION 'ZAC16'.
ENDMODULE. " EXIT_PROGRAM INPUT
Maybe you are looking for
-
I am a beginner at Final Cut Pro. Need help converting MPEG-2 to use.
I am a beginner at Final Cut Pro. I have mpeg-2 video footage that I am trying to import the footage into Final cut, but can't. I understand I need to convert the file format. I am unfamiliar with how to go about the converding file formats and the c
-
I tried to update my Firefox to version 4 last night. When it was complete, it asked me to restart my computer. After restarting the computer multiple times, I am continuing to get the message when trying to open Firefox. I also cannot uninstall Fire
-
In Yahoo Mail thumbnail photos appear broken in email messages
I cannot view thumbnail photos in email messages that have photo attachments in my Yahoo Mail. The thumbnail appears as a broken image. When I click on the thumbnail it does open up a valid photo image. The problem occurs all the time in every email
-
Been searching discussions for information on converting DVD's to either MP4 or M4V format. About the only free source I can find is HandBrake. Is that the best one?
-
Hi, one of my colleagues gets the follwoing message when attempting to access Table/view MASE via SM30: <b>The maintenance dialog for MASE is incomplete or not defined Message no. SV037 Diagnosis The called function with the view/table MASE needs a s