Data entry in module pool screen
Hi all,
I have created a module pool program. on the screen of the program, i have entered a dictionary field KNA1-KUNNR. On the second field on the screen, i have coded a search help to generate the F4 help based on the entries in the first field. Now the problem is that the entry made in the first screen is not available in the code, i.e. when i have entered a value in the first screen, in the debugger it shows the field as empty. i tried declaring a variable of the same name as the field, but it gives me error that the variable is already declared. any help will be appreciated.
regards,
hamza
Hi,
You can write like:
DATA : TB_DYNPFIELDS LIKE DYNPREAD OCCURS 0 WITH HEADER LINE. "internal table declared
CLEAR: TB_DYNPFIELDS.
REFRESH: TB_DYNPFIELDS.
MOVE 'ZTG_EMP-HLTH_PLAN' TO TB_DYNPFIELDS-FIELDNAME. " fieldname whose value needs to be catched dynamically
APPEND TB_DYNPFIELDS.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = 'SAPMZTG01' *"program name *
DYNUMB = '1010' "screen number
TRANSLATE_TO_UPPER = ' '
REQUEST = ' '
PERFORM_CONVERSION_EXITS = ' '
PERFORM_INPUT_CONVERSION = ' '
DETERMINE_LOOP_INDEX = ' '
START_SEARCH_IN_CURRENT_SCREEN = ' '
START_SEARCH_IN_MAIN_SCREEN = ' '
START_SEARCH_IN_STACKED_SCREEN = ' '
START_SEARCH_ON_SCR_STACKPOS = ' '
SEARCH_OWN_SUBSCREENS_FIRST = ' '
SEARCHPATH_OF_SUBSCREEN_AREAS = ' '
TABLES
DYNPFIELDS = TB_DYNPFIELDS "internal table to be passed
EXCEPTIONS
INVALID_ABAPWORKAREA = 1
INVALID_DYNPROFIELD = 2
INVALID_DYNPRONAME = 3
INVALID_DYNPRONUMMER = 4
INVALID_REQUEST = 5
NO_FIELDDESCRIPTION = 6
INVALID_PARAMETER = 7
UNDEFIND_ERROR = 8
DOUBLE_CONVERSION = 9
STEPL_NOT_FOUND = 10
OTHERS = 11
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
READ TABLE TB_DYNPFIELDS INDEX 1.
IF SY-SUBRC EQ 0.
PLAN_ID = TB_DYNPFIELDS-FIELDVALUE. *"internal table passed in the funcn module has one field as fieldvalue which will catch that fields value dynamically *
ENDIF.
Hope it helps you
Regrds
Mansi
Similar Messages
-
How to display image and data in module pool screen?
Hi,
I want to display image and relevant data besides the image in module pool screen, I am using docking container to display the image.
Actually I am able to display image or data any one but not both.
one more thing I want to display multiple images and their data.
Please suggest some one if you have any idea.
Regards,
Dileep.You can try below way, I have used in report.
DATA: gc_docking TYPE REF TO cl_gui_docking_container, "#EC NEEDED "Docking Container
gc_split TYPE REF TO cl_gui_easy_splitter_container, "#EC NEEDED "Splitter
gc_top_container TYPE REF TO cl_gui_container, "#EC NEEDED "Top Container
gc_bottom_container TYPE REF TO cl_gui_container, "#EC NEEDED "Bottom Container
gc_document TYPE REF TO cl_dd_document, "#EC NEEDED "Document
gc_events TYPE REF TO lcl_event_class, "#EC NEEDED " Local Event Class
gc_grid TYPE REF TO cl_gui_alv_grid, "#EC NEEDED " ALV Class
" Creating Docking
CREATE OBJECT gc_docking
EXPORTING
ratio = c_95.
IF sy-subrc EQ 0.
* Splitting the Docking container
CREATE OBJECT gc_split
EXPORTING
parent = gc_docking
sash_position = c_10 "Position of Splitter Bar (in Percent)
with_border = c_1. "With Border = 1 Without Border = 0
ENDIF.
* Placing the containers in the splitter
gc_top_container = gc_split->top_left_container .
gc_bottom_container = gc_split->bottom_right_container .
* Creating Grid
CREATE OBJECT gc_grid
EXPORTING
i_parent = gc_bottom_container.
ELSE.
* Background job handling
CREATE OBJECT gc_grid
EXPORTING
i_parent = gc_docking.
ENDIF.
* Creating the document
CREATE OBJECT gc_document
EXPORTING
style = 'ALV_GRID'.
Regards,
Sameer -
Display Continuous Fluctuations in Input Data in Module Pool Screen
Dear All,
We are working on a Weighbridge Interface scenario, where the weighbridge is sending data to a digitizer, which is connected to the COM port of a PC. The objective is to read the data from the digitizer, and display in a Module pool screen. However, there is one more requirement: the weight may fluctuate until it stabilizes, and the fluctuations have to be displayed on screen. For example, the tare weight of a vehicle may be 12.4 TON, but when the vehicle is standing on the weighbridge, the weight may vary from 10.4 to 12.4 TON. The idea is to capture the stable weight, so that any discrepancies can be avoided. In the current IT system implementation, the fluctuations in the weight are displayed. But using ABAP, can these fluctuations be captured? For example, we may design a screen containing a field for capturing the weight, and the weight displayed there automatically refreshes as soon as there is a change in the digitizer reading. Is this possible to achieve? If so, how?
Awaiting answers.
Thanks and Regards,
SidHi Sid,
just a suggestion for the refreshing of an ABAP screen: you can use class CL_GUI_TIMER, but it only handles whole seconds, i.e. 1 second, 2 seconds and so on, but not 0.5 seconds...
An example of an ABAP listing could be the following:
*& Report ZZAVV001
REPORT zzavv001 NO STANDARD PAGE HEADING.
CONSTANTS: c_yes(1) TYPE c VALUE 'X'.
DATA: BEGIN OF t_bseg OCCURS 0.
INCLUDE STRUCTURE bseg.
DATA: END OF t_bseg.
data: d_num_bkpf type i,
d_num_bseg type i.
PARAMETERS: interval TYPE i DEFAULT 5. "meaning 5 seconds
* CLASS lcl_receiver DEFINITION
CLASS lcl_receiver DEFINITION.
PUBLIC SECTION.
METHODS:
handle_finished FOR EVENT finished OF cl_gui_timer.
ENDCLASS. "lcl_receiver DEFINITION
* Global data
DATA:
test TYPE i,
receiver TYPE REF TO lcl_receiver,
timer TYPE REF TO cl_gui_timer.
START-OF-SELECTION.
CREATE OBJECT timer.
CREATE OBJECT receiver.
SET HANDLER receiver->handle_finished FOR timer.
timer->interval = interval.
CALL METHOD timer->run.
PERFORM load_data. "or whatever you have to do to read the weight
PERFORM show_list. "or whatever you have to do to print the weight you've read
* CLASS lcl_receiver IMPLEMENTATION
CLASS lcl_receiver IMPLEMENTATION.
METHOD handle_finished.
PERFORM carga_datos.
PERFORM muestra_listado.
CALL METHOD timer->run.
ENDMETHOD. "handle_finished
ENDCLASS. "lcl_receiver IMPLEMENTATION
*& Form load_data
* text
FORM load_data.
clear: d_num_bkpf,
d_num_bseg.
select single count( * )
into d_num_bkpf
from bkpf.
select single count( * )
into d_num_bseg
from bseg.
ENDFORM. "load_data
*& Form show_list
* text
FORM show_list.
get time.
skip to line 1.
position 1.
write: / 'Date / Time:', sy-datum, sy-uzeit.
write: / 'Number of BKPF records:', d_num_bkpf.
write: / 'Number of BSEG records:', d_num_bseg.
ENDFORM. " show_list
Okay, it's just a tiny code snippet, but I hope it may help you by designing auto-refreshing screens.
Kind regards,
Alvaro -
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. -
How to use table maintenance view in module pool screen
hi ,
want to use table maintenance view in a module pool screen so that i can edit, insert, delete and update date in to the ztable.please help.You can simply call it via SM30. Or you can call the table maintence view from any program(report or module pool) using a function module.
call function 'VIEW_MAINTENANCE_CALL'
exporting
action = 'U'
view_name = 'Z_Table_Name'
exceptions
client_reference = 1
foreign_lock = 2
invalid_action = 3
no_clientindependent_auth = 4
no_database_function = 5
no_editor_function = 6
no_show_auth = 7
no_tvdir_entry = 8
no_upd_auth = 9
only_show_allowed = 10
system_failure = 11
unknown_field_in_dba_sellist = 12
view_not_found = 13
others = 14.
Regards,
RIch Heilman -
Icon display in Module pool screen not visible to some users
Hi,
I have added an icon in one of the module pool screen with dynamic quick info. The page is rendered fine and the info is also displayed well for most users except some. I can't figure out why the icon is not being displayed for some users.
Do someone has any solution for this?
Thanks,
SumithAs I recall, the icons are actually stored in a file on each PC so some users may have a corrupted or out-of-date file with the icons. You can look for posting on "how to add an icon" to see a discussion on this topic.
I found some useful info at:
Create and Add Icons to table ICON?
Message was edited by: Charles Folwell -
How to handle The Back button on Module Pool screen
Hi Gurus,
I have created a module pool screen. In that screen I have used some input/output fields(text box) which i have marked mandatory by making the input field as "required" under program tab.
now when running the screen if no data is entered into these mandatory input field then BACK button does not work. First I have to enter some data into the input filed only then the BACK button works. How should i code so that the back button works even without entering the data into these mandatory fields.hi,
use AT EXIT-COMMAND with the module.
eg. module user_command at exit command.
then there will be no problem. -
How to insert tabstrip control in module pool screen painter
Hi all!
plz tell e how to use tabstrip control in module pool screen painter.Also plz give me an example program using tabstrip control.To insert tabstrip just open layout of screen and press on the tabstrip button there .
Use this souce code further to activate it .
CONTROLS tabstrip TYPE TABSTRIP.
DATA: okcode TYPE sy-ucomm,
dynnr TYPE sy-dynnr,
flag type flag,
active like tabstrip-activetab .
call SCREEN 100.
*& Module USER_COMMAND_0100 INPUT
text
MODULE USER_COMMAND_0100 INPUT.
data: lv_okcode type syucomm.
lv_okcode = okcode.
clear okcode.
case lv_okcode.
WHEN 'TAB1'.
dynnr = '0110'.
WHEN 'TAB2'.
dynnr = '0120'.
WHEN 'TAB3'.
dynnr = '0130'.
WHEN 'TAB4'.
dynnr = '0140'.
WHEN 'TAB5'.
"check authorization, if authorization fails
flag = 'X'. "set the global flag
active = 'TAB1'. "store active tab in global variable
dynnr = '0110'. "set the screen number
WHEN 'BACK' or 'EXIT'.
leave program.
ENDCASE.
IF lv_okcode(3) = 'TAB'.
tabstrip-activetab = lv_okcode.
ENDIF.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Module STATUS_0100 OUTPUT
text
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'MAIN'.
SET TITLEBAR 'xxx'.
IF tabstrip-activetab IS INITIAL OR
dynnr IS INITIAL.
tabstrip-activetab = 'TAB1'.
dynnr = '0110'.
ENDIF.
"set the activetab explicilty here
if flag eq 'X'. "from authorization failure
tabstrip-activetab = active. "'TAB1'
clear flag.
endif.
ENDMODULE. " STATUS_0100 OUTPUT -
How to add logo in module pool screen
Hi Expert,
I need to display company logo in the module pool screen
how this can be added ?
Regards
BikasHi,
create a custom control called 'CUSTOM_CONTROL'
CONSTANTS: CNTL_TRUE TYPE I VALUE 1,
CNTL_FALSE type i value 0.
data:h_picture type ref to cl_gui_picture,
h_pic_container type ref to cl_gui_custom_container.
data: graphic_url(255),
graphic_refresh(1),
g_result like cntl_true.
data: begin of graphic_table occurs 0,
line(255) type x,
end of graphic_table.
data: graphic_size type i.
data: g_stxbmaps type STXBITMAPS,
l_bytecnt type i,
l_content TYPE standard table of bapiconten initial size 0.
g_stxbmaps-tdobject = 'GRAPHICS'.
g_stxbmaps-tdname = 'ENJOY'.
g_stxbmaps-tdid = 'BMAP'.
g_stxbmaps-tdbtype = 'BMON'.
call function 'SAPSCRIPT_GET_GRAPHIC_BDS'
exporting
i_object = g_stxbmaps-tdobject
i_name = g_stxbmaps-tdname
i_id = g_stxbmaps-tdid
i_btype = g_stxbmaps-tdbtype
importing
e_bytecount = l_bytecnt
tables
content = l_content
exceptions
not_found = 1
bds_get_failed = 2
bds_no_content = 3
others = 4.
call function 'SAPSCRIPT_CONVERT_BITMAP'
exporting
old_format = 'BDS'
new_format = 'BMP'
bitmap_file_bytecount_in = l_bytecnt
importing
bitmap_file_bytecount = graphic_size
tables
bds_bitmap_file = l_content
bitmap_file = graphic_table
exceptions
others = 1.
call function 'DP_CREATE_URL'
exporting
type = 'image'
subtype = cndp_sap_tab_unknown
size = graphic_size
lifetime = cndp_lifetime_transaction
tables
data = graphic_table
changing
url = graphic_url
exceptions
others = 4 .
create object h_pic_container
exporting container_name = 'CUSTOM_CONTROL'.
create object h_picture exporting parent = h_pic_container.
call method h_picture->set_display_mode
exporting
display_mode = cl_gui_picture=>display_mode_normal.
call method h_picture->load_picture_from_url
exporting url = graphic_url
importing result = g_result.
or you can check the program RSDEMO_CUSTOM_CONTROL
check link :
How to insert Image on Screen
thanks
Parvathi -
How to give ** bydefault in password in module pool screen .
Hi experts
how to give ******* by default in password in module pool screen .
ThanksHi ,
Double click on the field u will get a pop up window
i.e. attribute window for that field.
in that window you have a tab called Program at the bottom.
in program tab you have many checkboxes.
check the check box with name *Entry.
and activate.
what ever you enter now will be in password formate
Regards
Ajay -
Displaying MIR4 attachment list TIF image in module pool screen
Hi All,
I have a screen with a custom container and I tried to call a TIF image from MIR4 which is in attachment list(which is stored in archived link).
I need a function module to display this image in my Module pool screen using the container.
I tried using below code
* Create controls
CREATE OBJECT container_1
EXPORTING
container_name = 'CONTAINER'.
* create object container_2
* exporting container_name = 'PICTURE_CONTROL_2'.
CREATE OBJECT PICTURE_CONTROL_1
EXPORTING
parent = container_1.
* CREATE OBJECT PICTURE_CONTROL_2 exporting parent = container_2.
CALL METHOD PICTURE_CONTROL_1->LOAD_PICTURE_FROM_URL
EXPORTING
* URL = 'SAPR3://984BE16932C81EE3B2AA1E3B0D12C6FF'
* URL = 'file://E:\Personal\New_Passport4.jpg'
* URL = 'SAPR3://984BE16932C81EE3B2BDF8E44B035648.TIF'
*URL = 'SAPR3://SAPR3CMS/get/100/Z1/984BE16932C81EE3B2BDF8E44B035648//.TIF'.
URL = 'SAPR3://WebRepository/0020698212/DEMOWORD97SAPLOGO?Version=00000'
IMPORTING
RESULT = lv_result.
CALL METHOD PICTURE_CONTROL_1->set_display_mode
EXPORTING
display_mode = PICTURE_CONTROL_1->display_mode_fit_center.
But I am able to display this URL = 'SAPR3://WebRepository/0020698212/DEMOWORD97SAPLOGO?Version=00000' and not able to display my archive link image which is in TIF.
note: Display image of Arc.link Doc.type ZBUSI_TIF (doc.class TIF)
Please help me on this.
Thanks
Geetha CharanHi sai,
Please refer th procedure.
For the select-options you might have defined a selection screen.
Next you can fetch the entire data that you wanted to display in a module pool into an internal table.
you can call the screen you defined for o/p upon the selection.
Then, You define a screen XXXX and a table control in the scree, and in the PAI module of the screen
you write a chain end chain processing in which you can display the contents of your internal table.
OR
if you want the selection also to be in the module pool, then for displaying the O/P you can definr a sub-screen of the initial screen and you can call that sub-screen on selcting, which can be done with a function code.
Hope this helps -
Expand/collapse button functionality on module pool screen
Hi ,
I want to design a module pool screen with a expand/collapse button on it.
The desired functionality associated with this button would be something similiar to that available in ME21N screen. When the expand button is clicked it should open up a section of screen that allows the user to enter some parameter. Based on this parameter some selections from DB can be perfomed and then displayed below it.
Any pointers on how to achieve this? Any kind of help would be appreciated.
Regards-
Harmeet Singh.example for three pushbutton with expand collapse .
First of all define your push button as output field with icon tick in the pushbutton characteristick,
then define this pushbutton in top_include
include <icon>.
data : push_a1 like icons-l4,
push_a2 like icons-l4,
push_a3 like icons-l4.
data : a1 ,
a2,
a3.
in pai of the screen
suppose i had assign function code a1 ,a2 , a3 for repective pushbutton
module user_command_9002 input.
okcd = ok_code.
clear ok_code.
case okcd.
when 'A1'.
if a1 is initial.
a1 = 'X'.
else.
clear a1.
endif.
when 'A2'.
if a2 is initial.
a2 = 'X'.
else.
clear a2.
endif.
when 'A3'.
if a3 is initial.
a3 = 'X'.
else.
clear a3.
endif.
endcase.
endmodule. " USER_COMMAND_9002 INPUT
define three seprate screen -group for three pushbutton say a1 a2 a3
during pbo you can directly assign name of icon .
if a1 is initial.
push_a1 = icon_collapse.
else.
push_a1 = icon_expand.
endif.
if a2 is initial.
push_a2 = icon_collapse.
else.
push_a2 = icon_expand.
endif.
if a3 is initial.
push_a3 = icon_collapse.
else.
push_a3 = icon_expand.
endif.
loop at screen.
if screen-group1 = 'A1'.
if a1 = 'X'.
screen-invisible = 1.
screen-input = 0.
modify screen.
else.
screen-active = 1.
screen-invisible = 0.
screen-input = 1.
endif.
elseif screen-group1 = 'A2'.
if a2 = 'X'.
screen-invisible = 1.
screen-input = 0.
modify screen.
else.
screen-active = 1.
screen-invisible = 0.
screen-input = 1.
endif.
elseif screen-group1 = 'A3'.
if a3 = 'X'.
screen-invisible = 1.
screen-input = 0.
modify screen.
else.
screen-active = 1.
screen-invisible = 0.
screen-input = 1.
endif.
endif.
endloop.
regards,
Alpesh
Edited by: Alpesh on May 28, 2009 10:28 AM -
Module-pool screen field value under POV event
Hi All,
I have one issue...please suggest me solution for this.
In module-pool program i have one screen(1000) which has one field(hrname_1000).
Under this event:
PROCESS ON VALUE-REQUEST.
FIELD hrname_1000 MODULE hrname_1000.
under this module hename_1000 i have used F4IF_INT_TABLE_VALUE_REQUEST to put a search help for field hrname_1000.
after that i am trying to retrive HR related stuff's based on the field on module-pool i.e i am using hrname_1000 in the where condition.
but problem is that im not getting value for hrname_1000 which im giving in the module-pool screen.
thats y my select query is not working.
Where as im getting values for the hrname_1000 under PBO & PAI.
It will look like below.
PROCESS ON VALUE-REQUEST.
FIELD hrname_1000 MODULE hrname_1000.
(under the above module)
SELECT DISTINCT ename plans FROM pa0001 INTO CORRESPONDING FIELDS OF TABLE itab WHERE stell = '50001026'.
LOOP AT itab INTO wa WHERE ename = hrname_1000.
ENDLOOP.
Please suggest
Thanks & regards
AnsumeshIn some of the cases the screen field is present in the screen but not holding the value in the required structure or field.
so here u need to check the option of reading the screen field values explictly..
//once u hit an enter and do the f4 i think the value will be there ...but if u dont hit enter and do an F4 the value cannot hold and i think u r in this case ..
1.Fill the screen field name in the structure dynpread.
DATA: BEGIN OF DYNP_VALUES OCCURS 10.
INCLUDE STRUCTURE DYNPREAD.
DATA: END OF DYNP_VALUES.
DYNP_VALUES-FIELDNAME = 'HRNAME_1000'.
APPEND DYNP_VALUES.
* read screen values
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = HELP_REPID "call the repid of ur prog
DYNUMB = HELP_DYNNR "pass the screen number
TABLES
DYNPFIELDS = DYNP_VALUES
EXCEPTIONS
OTHERS = 1.
now dynp_values hold the field name and field value of the screen .
now
SORT DYNP_VALUES BY FIELDNAME.
READ TABLE DYNP_VALUES WITH KEY 'HRNAME_1000' BINARY SEARCH.
IF SY-SUBRC EQ 0.
HELP_XXXX = DYNP_VALUES-FIELDVALUE. "store the value into a variable
TRANSLATE HELP_XXXX TO UPPER CASE.
ENDIF.
Now check the code with the value if its getting populated which once there will make ur select work ..
Vijay.. -
Getting select options in module pool screen
hi experts,
can any one suggest me how to provide select options in module pool screen.
thank you,
regards
vijayHi,
Take two fields on screen first for low value and other for high value (say vbeln_low and vbeln_high) also design a button next to the high textbox for select-option button used to display popup.
Using these two input fields append a range (say r_vbeln for vbap-vbeln) for the field to be used (either in query or anywhere).
ranges : r_vbeln for vbap-vbeln.
IF NOT vbeln_high IS INITIAL.
IF NOT vbeln_low LE vbeln_high.
MESSAGE e899 WITH text-007. "high value is smaller than low value
ENDIF.
ENDIF.
r_vbeln-sign = 'I'.
r_vbeln-low = vbeln_low.
IF vbeln_high IS INITIAL.
r_vbeln-option = 'EQ'. "if user takes only a singlr value
ELSE.
r_vbeln-option = 'BT'. "if user takes both low & high value
r_vbeln-high = vbeln_high.
ENDIF.
APPEND r_vbeln. "append range
CLEAR r_vbeln.
On the button click call this FM to call a popup for select-options.
DATA : tab TYPE rstabfield.
tab-tablename = 'VBAP'.
tab-fieldname = 'VBELN'.
CALL FUNCTION 'COMPLEX_SELECTIONS_DIALOG'
EXPORTING
title = text-002
text = ' '
signed = 'X'
* lower_case = ' '
* no_interval_check = ' '
* just_display = ' '
* just_incl = ' '
* excluded_options =
* description =
* help_field =
* search_help =
tab_and_field = tab
TABLES
range = r_vbeln
EXCEPTIONS
no_range_tab = 1
cancelled = 2
internal_error = 3
invalid_fieldname = 4
OTHERS = 5.
IF sy-subrc EQ 2.
MESSAGE s899 WITH text-003. "no value selected
ELSEIF sy-subrc <> 0 AND sy-subrc <> 2.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
This whole code will append your range r_vbeln to be used in program.
Hope this solves your problem.
Thanks & Regards,
Tarun Gambhir -
How to creat select-option on module pool screen???
Hi All,
please tell me how to creat select-option on module pool screen???
Regards
DeepakHi Deepak Kumar Sharma,
There are Two ways to achieve it...
1) How to create a select-options in a module pool screen.
Method 1
a) Create a subscreen area in your screen layout where you want to create the select options.
b) In the top include of your module pool program declare a selection screen as a subscreen e.g.
SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.
select-options s_matnr for mara-matnr.
SELECTION-SCREEN END OF SCREEN.
c) In the PBO and PAI of the main screen where the select options needs to be created do a call subscreen of the above screen (100).
CALL SUBCREEN sub_area INCLUDING <program> <screen>
This call subscreen statement is necessary for transport of values between screen and program.
Note: All validations of the selection screen fields e.g. the s_matnr field created above should be done in selection screen events like AT SELECTION-SCREEN etc and not in PAI. These selection screen validations etc should be done in the top include only.
Method 2
a) Create 2 separate fields in your screen layout - one for the low value and one for the high value. Insert an icon beside the high value which will call the multiple selections popup screen on user command. Use function module COMPLEX_SELECTIONS_DIALOG to achieve this.
struc_tab_and_field-fieldname = con_cust. " 'KUNNR'
struc_tab_and_field-tablename = con_kna1. " 'KNA1'.
CALL FUNCTION 'COMPLEX_SELECTIONS_DIALOG'
EXPORTING
TITLE = ' '
text = g_titl1 " 'Customers'
tab_and_field = struc_tab_and_field
TABLES
RANGE = rng_kunnr
EXCEPTIONS
NO_RANGE_TAB = 1
CANCELLED = 2
INTERNAL_ERROR = 3
INVALID_FIELDNAME = 4
OTHERS = 5.
IF NOT rng_kunnr[] IS INITIAL.
Read the very first entry of the range table and pass it to
dynpro screen field
READ TABLE rng_kunnr INDEX 1.
IF sy-subrc = 0.
g_cust = rng_kunnr-low.
ENDIF.
You can use the return table rng_kunnr to populate your own internal range table with the values entered by the user. Basically here you are just simulating the work of a select-options parameter by module pool screen elements.
Also have a look on below threads
how to make select option in module pool
select option in module pool program
Hope it will solve your problem..
Thanks & Regards
ilesh 24x7
Maybe you are looking for
-
I can´t synchronize my devices by Bluetooth
I have installed OS X Yosemite 10.10.1 in may MacBook, but I can´t Sync with iPhone 5, neither iPad. Could it be storage size in iCloud ?
-
Flash project from Romania not displaying on my UK PC
We have had a couple of pieces of work produced in Romania. The companies in Romania have supplied web links for us to view the projects - one a flipbook the other a website and all we get is a blank screen with a grey square. I noticed that the enco
-
How to Show last 6 months?
Hi Guys, I have a report that must show the last 6 months. If you open the report let's say on the 02.02.2010, this report must have the following columns and the following order: Jan 2010 - Dec 2009 - Nov 2009 - Oct 2009 - Sep 2009 - Aug 2009. Is it
-
Doc Pages09 export in PDF: No TOC ?
Hello, I created a document with Pages09 containing a table of contents (summary), bookmarks and hyperlinks, everything works! When I export to PDF, no table of contents is created in the right column, only the thumbnails are available! Pages09 is he
-
Printing question HP6515 - Envelope Size: 3 1/2 X 5 inches
Hello - Can an HP6515 printer print an envelope who's dimensions are 3 1/2 X 5 inches? I don't want to ruin a bunch of envelopes if the printer isn't designed to handle that size envelope. Thank you for your help and assistance. Bogdan2015