Date field in module pool
hi all,
i want to have date field in module pool with F4 help. m keeping format as DATS. but still its not taking F4 help for taking date from calender...how shud i do it.
Call this FM -
CALL FUNCTION 'F4_DATE'
EXPORTING
DATE_FOR_FIRST_MONTH = DATE
DISPLAY = HELPDISP
IMPORTING
SELECT_DATE = DATE
EXCEPTIONS
OTHERS = 4.
Regards,
Amit
Reward all helpful replies.
Similar Messages
-
F4 help for the Date field in Module-Pool program
Hi,
I have a requirement wherein the user shud be allowed to choose a date on the calendar using F4 help and after choosing, it shud get displayed as dd.mm.yyyy format in the field. Is there any functional module to implement this.
Thanks in Advance,
Saranya.Hi,
Please try the below code in your prgm.
You have to write the below code in the POV of the required field.
***INCLUDE MZDATE_POV_DATEI01 .
*& Module pov_date INPUT
text
module pov_date input.
DATA: li_ret_tab LIKE ddshretval OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = ' '
fieldname = ' '
searchhelp = 'BU_DATE_CHAR'
TABLES
return_tab = li_ret_tab
EXCEPTIONS
field_not_found = 1
no_help_for_field = 2
inconsistent_help = 3
no_values_found = 4
OTHERS = 5.
IF sy-subrc IS INITIAL.
READ TABLE li_ret_tab INDEX 1.
IF sy-subrc IS INITIAL.
wrk_date = li_ret_tab-fieldval. "The required field
ENDIF.
ENDIF.
endmodule. " pov_date INPUT
Hope it suits ur requirement.
Reward points if useful.
Thanks and regards,
Litta. -
How to delete the row in table control with respect to one field in module pool programming?
Hi,
Can I know the way to delete the row in table control with respect to one field in module pool programming
Regards
Darshan MSHI,
I want to delete the row after the display of table control. I have created push button as delete row. If I click on this push button, the selected row should get deleted.
I have written this code,
module USER_COMMAND_9000 input.
DATA OK_CODE TYPE SY-UCOMM.
OK_CODE = SY-UCOMM.
CASE OK_CODE.
WHEN 'DELETE'.
LOOP AT lt_source INTO ls_source WHERE mark = 'X'.
APPEND LS_SOURCE TO LT_RESTORE.
DELETE TABLE LT_SOURCE FROM LS_SOURCE.
SOURCE-LINES = SOURCE-LINES - 1.
ENDLOOP.
But I'm unable to delete the selected rows, It is getting deleted the last rows eventhough I select the other row.
So I thought of doing with respect to the field. -
F1 help on a field in module pool programming
I want to create f1 help on a field in module pool programming. How to use POH event. where should i write the help documentation. Before using this f1 help on a field i have to set some properties on GUI interface Editor. Please clearly mention the steps i have to follow.
PROCESS ON HELP-REQUEST.
FIELD P_LFA1 MODULE HELP_F1_LIFNR.
MODULE HELP_F1_LIFNR INPUT.
PERFORM SHOW_HELP_F1 USING 'ZFAG_DOC1'.
ENDMODULE. " help_f1_lifnr INPUT
FORM SHOW_HELP_F1 USING P_OBJECT.
Dati testo help
DATA: T_LINE LIKE TLINE OCCURS 0,
XHEAD LIKE THEAD,
HELP_INFO LIKE HELP_INFO,
TEXC LIKE SY-UCOMM OCCURS 0,
V_OBJECT LIKE DOKHL-OBJECT.
Costante
DATA: PREF_SIMG(4) VALUE 'SIMG',
DOCID_HY LIKE DOKHL-ID VALUE 'HY'.
Testo
CONCATENATE PREF_SIMG P_OBJECT INTO V_OBJECT.
Estrazione testo
CALL FUNCTION 'DOCU_GET_FOR_F1HELP'
EXPORTING
ID = DOCID_HY
LANGU = SY-LANGU
OBJECT = V_OBJECT
IMPORTING
HEAD = XHEAD
TABLES
LINE = T_LINE
EXCEPTIONS
RET_CODE = 1
OTHERS = 2.
CASE SY-SUBRC .
WHEN 0.
Visualizzazione testo
GET CURSOR FIELD HELP_INFO-DYNPROFLD.
HELP_INFO-DOCUID = DOCID_HY.
HELP_INFO-DOCUOBJECT = V_OBJECT.
HELP_INFO-SPRAS = SY-LANGU.
HELP_INFO-PROGRAM = SY-REPID.
HELP_INFO-DYNPRO = SY-DYNNR.
HELP_INFO-DYNPPROG = SY-REPID.
HELP_INFO-PFKEY = SY-PFKEY.
HELP_INFO-FIELDNAME = HELP_INFO-DYNPROFLD.
CALL FUNCTION 'HELP_DOCULINES_SHOW'
EXPORTING
HELP_INFOS = HELP_INFO
OVERLAY_HEADER = XHEAD
TABLES
EXCLUDEFUN = TEXC
HELPLINES = T_LINE.
WHEN OTHERS. MESSAGE S720(SH).
ENDCASE.
ENDFORM. " SHOW_HELP_F1 -
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 do ICON_EXPAND and ICON_COLLAPSE input fields in module pool screen?
hi frnds.
My problem is in module pool screen how to do ICON_EXPAND and ICON_COLLAPSE input fields in module pool screen?And how to do GUI STATUS and GUI TITLE? IN SE80.
ITS URGENT.POINTS WILL BE REWADED.THANKS IN ADVANCE.Hi,
Go through this thread.
[expand and collapse|expand and collapse]
Cheers,
Simha. -
F4 help for the screen fields in module pool program
Hi All,
I have a requirement that, i want to provide F4 help for the 2 fields in module pool program. the fields are document number and fiscal year from rbkp table.
i could provide search help for two fields.
but how to select matching fiscal year for that document number.
problem: i am getting fiscal year as first four digits of document number.
please help me to solve this problem.
Thanks & Regards,
Namratha.VHi,
If your requirement is after selecting the document no from f4 help then the corresponding year should be updated in the document year field then use FM --> DYNP_VALUES_UPDATE
In this function module pass the screen no program & field for which u want to update value -
Problem with I/O field in module pool
hi experts,
I am displaying some text in I/O field in module pool screen. I am giving the attributes of I/O field as "output only" type and no input. Initially the input was not enabled for it, only it should be in display mode. Once i click on 'CHANGE' pushbutton then only the input should be enabled and it should be in change mode.will u tell me how to do it programatically.HI,
In PAI of that screen..
when the sy-ucom is 'Change' then use the Loop at screen--Endloop to modify the attributes value.
example..
LOOP AT screen
CASE screen-name.
WHEN 'Fieldname.
screen-input = 0.
screen-active = 0.
MODIFY screen.
ENDCASE.
Edited by: avinash kodarapu on Dec 10, 2008 12:16 PM -
How to pass the Data to sclect option field in module pool??
Hai Experts,
I have Created the Select-Options using Sub screen its working fine for me.
But the problem is when i pass the data to one of the my select options field its not showing in display mode..
please me this
i created select option slike this,
SELECTION-SCREEN BEGIN OF SCREEN 400 AS SUBSCREEN.
SELECT-OPTIONS : s_kunnr FOR wa_zcodntr-fin_kunnr,
s_altkn FOR wa_zcodntr-altkn.
SELECTION-SCREEN END OF SCREEN 400 .
Thanks ,
Adv.Thanks SAP_wiz kick replay,
Actullay in my module pool screen i have to select option field like F1 and F2
any one filed give the input and excute pick the coresponding data for F2 (select option) field and display and vice -versa. -
Search Help For a Field in Module Pool Programming
Hi,
I have a field called status in Module Pool for which i need to write a search help.
This is the piece of code i have written.
TYPES: BEGIN OF ty_status,
stat type i,
status type string,
END OF ty_status.
DATA: lt_emp_status TYPE STANDARD TABLE OF ty_status,
lw_emp_status TYPE ty_status.
REFRESH lt_emp_status.
lw_emp_status-stat = '1'.
lw_emp_status-status = 'Draft'.
APPEND lw_emp_status TO lt_emp_status.
CLEAR lw_emp_status.
lw_emp_status-stat = '2'.
lw_emp_status-status = 'Employee Review'.
APPEND lw_emp_status TO lt_emp_status.
CLEAR lw_emp_status.
REFRESH lt_emp_status.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'STATUS'
value_org = 'S'
TABLES
value_tab = lt_emp_status
return_tab = t_return
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc = 0.
READ TABLE t_return INDEX 1.
MOVE t_return-fieldval TO LV_EMP_status.
ENDIF.
But i am getting the following error.
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_SY_ASSIGN_CAST_ILLEGAL_CAST', was
not caught in
procedure "F4IF_INT_TABLE_VALUE_REQUEST" "(FUNCTION)", nor was it propagated by
a RAISING clause.
Since the caller of the procedure could not have anticipated that the
exception would occur, the current program is terminated.
The reason for the exception is:
The error occurred at a statement of the form
ASSIGN f TO <fs> CASTING.
ASSIGN f TO <fs> CASTING TYPE t.
or
ASSIGN f TO <fs> CASTING LIKE f1.
or
at table statements with the addition
ASSIGNING <fs> CASTING.
The following error causes are possible:
1. The type of field f or the target type determined by <fs>, t or f1
contains data references, object references, strings or internal tables
as components.
Could some one help me how to resolve this issue.
Thanks in advance.Hi,
Please see this sample code below:
*To fetch the classification data on the sel screen
DATA: BEGIN OF IT_KLAH OCCURS 0,
CLINT TYPE CLINT,
CLASS TYPE KLASSE_D,
END OF IT_KLAH.
SELECT CLINT CLASS FROM KLAH UP TO 500 ROWS
INTO TABLE IT_KLAH.
IF SY-SUBRC <> 0 .
MESSAGE TEXT-006 TYPE 'E'.
ELSE.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
RETFIELD = 'CLASS'
PVALKEY = ' '
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'p_s_clascn_low' "i had to put the f4 help on the selection screen's select option low value,
"here basically you have to give the internal table name inside quotes in which
"you want to retrieve your data
VALUE_ORG = 'S'
DISPLAY = ' '
TABLES
VALUE_TAB = IT_KLAH.
ENDIF.
Hope it helps,
Regards,
Mansi -
Search help for screen fields in module pool
Hi All,
I have a screen in Module pool which has 3 input fields, each input field is attached to the same search help.
These fields are from ztable . I have created a search help USING these 3 fields. All the 3 fields are marked for IMPORT and EXPORT.
So whenever i click F4 on any of the above 3 fields, It will display search help popup and returns some rows...But the values are transfered back only for 1 fields ..i.e for the first field only .
I want that ...as soon as i select any of the row from Search hit list..all the 3 columns should get populated with corresponding fields from that row.
I require it this way as user wants to select based on * selection.Ex: as then every this related to that should be popped up.
Pls help ASAP
Thanks,This is how i got.
data:l_shlp type SHLP_DESCR,
l_rc type sy-subrc,
w_DDSHRETVAL type DDSHRETVAL ,
ls_shintf LIKE LINE OF l_shlp-interface,
t_DDSHRETVAL type TABLE OF DDSHRETVAL.
DATA: dyname LIKE d020s-prog,
dynumb LIKE d020s-dnum.
DATA: BEGIN OF dynpfields OCCURS 3.
INCLUDE STRUCTURE dynpread.
DATA: END OF dynpfields.
CALL FUNCTION 'F4IF_GET_SHLP_DESCR'
EXPORTING
SHLPNAME = 'YTESTDMSSB'
SHLPTYPE = 'SH'
IMPORTING
SHLP = l_shlp .
ls_shintf-valfield = 'X'.
MODIFY l_shlp-interface FROM ls_shintf TRANSPORTING valfield
WHERE shlpfield = 'SNNTX'.
MODIFY l_shlp-interface FROM ls_shintf TRANSPORTING valfield
WHERE shlpfield = 'SBRTX'.
MODIFY l_shlp-interface FROM ls_shintf TRANSPORTING valfield
WHERE shlpfield = 'SBSTX'.
MODIFY l_shlp-interface FROM ls_shintf TRANSPORTING valfield
WHERE shlpfield = 'ENPTX'.
MODIFY l_shlp-interface FROM ls_shintf TRANSPORTING valfield
WHERE shlpfield = 'PLANT_CODE'.
CALL FUNCTION 'F4IF_START_VALUE_REQUEST'
EXPORTING
SHLP = l_shlp
DISPONLY = ' '
MAXRECORDS = 500
MULTISEL = 'X'
CUCOL = SY-CUCOL
CUROW = SY-CUROW
IMPORTING
RC = l_rc
TABLES
RETURN_VALUES = t_DDSHRETVAL
IF l_rc = 0.
LOOP AT t_DDSHRETVAL INTO w_DDSHRETVAL.
CASE w_DDSHRETVAL-fieldname.
WHEN 'SNNTX'. "W_SNNTX = w_DDSHRETVAL-fieldval.
dyname = sy-repid.
dynumb = sy-dynnr.
dynpfields-fieldname = 'W_SNNTX'.
dynpfields-fieldvalue = w_DDSHRETVAL-fieldval.
APPEND dynpfields.
WHEN 'SBRTX'. "W_SBRTX = w_DDSHRETVAL-fieldval.
dyname = sy-repid.
dynumb = sy-dynnr.
dynpfields-fieldname = 'W_SBRTX'.
dynpfields-fieldvalue = w_DDSHRETVAL-fieldval.
APPEND dynpfields.
WHEN 'SBSTX'. "W_SBSTX = w_DDSHRETVAL-fieldval.
dyname = sy-repid.
dynumb = sy-dynnr.
dynpfields-fieldname = 'W_SBSTX'.
dynpfields-fieldvalue = w_DDSHRETVAL-fieldval.
APPEND dynpfields.
WHEN 'ENPTX'. "W_ENPTX = w_DDSHRETVAL-fieldval.
dyname = sy-repid.
dynumb = sy-dynnr.
dynpfields-fieldname = 'W_ENPTX'.
dynpfields-fieldvalue = w_DDSHRETVAL-fieldval.
APPEND dynpfields.
WHEN 'PLANT_CODE'. "W_ENPTX = w_DDSHRETVAL-fieldval.
dyname = sy-repid.
dynumb = sy-dynnr.
dynpfields-fieldname = 'W_WERKS'.
dynpfields-fieldvalue = w_DDSHRETVAL-fieldval.
APPEND dynpfields.
ENDCASE.
ENDLOOP.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = dyname
dynumb = dynumb
TABLES
dynpfields = dynpfields.
ENDIF. -
Hello ABAP Experts,
I am BW person, and looking to extract the data from the table display from one of the trasactions in R/3.
tcode: fmderive
i checked the the program it is : SAPMABADR (module pool)
fields of hte table belong to: structure FMDERIVE
If i can get the data into a internal table. That would be great, i can do the rest of the processing before i extract this data to BW.
Any suggestions appreciated.
Thanks,
BWerHi,
It is possible to extract data in internal table. The internal table should be of a particular STRUCTURE which is created in SE11. Populate the internal table in program.
I do not remember the exact command, but it is somewhat as below. With this it is possible to extract data in BW.
*<QUERY HEAD> "Always comment this statement
loop at it_data into wa_data.
append wa_data to it_fmderive.
endloop.
*<QUERY BODY> "Always comment this statement
The internal table it_fmderive can be used to extract data in BW. This is the only way to extract data.
Also refer following link :
http://www.thespot4sap.com/articles/SAP_ABAP_Queries_DataRetrievalUsingProgram.asp
Best regards,
Prashant
Message was edited by: Prashant Patil -
I want to create sceen in module pool programming with 2 filed , one with type P length 8 decimals 2, and another with type I,
as I need it to do calculation.
can anybody suggest ?
thanksHi,
Its depend on your requirements-
If you want To display text then go for CHAR Type.
If you want to display number then Go for INT4/INT2/INT2
For amount DEE - So On.
Now Put the Text filed from List And Double Clicking on the field Attribute list is diaplyed , In the Distionary Attributes you put DATA TYPE.
Do not Forgrt to place OK-CODE Field In Element List.In the Element list you also Define the Type, Length attrubutes.
If Any Confusion let me know.
Regards,
Sujit -
Disobey the user profile date setting in module pool
Hi all,
I am working on a module pool. I have a request to disobey the user profile date setting dd/mm/yyyy to user requested date format dd-mm-yyyy.
I understand that it can easily be done in SAPScript with command SET DATE MAST dd-mm-yyyy, but how to do it in module pool?
Thanks in advance.Hi, Wong.
Follow the Steps Bellow
--> Copy Search Help BU_DATE_CHAR to ZBU_DATE_CHAR using T-Code SE11
--> Copy FM BUS_TOOLS_DATE_CHAR_EXIT to Z_BUS_TOOLS_DATE_CHAR_EXIT using T-Code SE37
--> Open ZBU_DATE_CHAR in Change mode and add Z_ in the Start of Search help exit FM as we have copy new
--> Active ZBU_DATE_CHAR it will not give you any Error message may be one Warning message but Ignore this.
--> Active Z_BUS_TOOLS_DATE_CHAR_EXIT my will give you error message do the following Change
in Changing Tab SHIP type SHLP_DESCR " Change the Previous type with this one.
in Tables Tab SHLP_TAB type SHLP_DESCT " Change the Previous type with this one.-->
--> After doing above changes.
--> Add the following line of Code on line number 92 just before the line APPEND record_tab.
REPLACE ALL OCCURRENCES OF '.' in record_tab-string WITH '-'.
--> Activate both Search Help and FM
now in the Search help filed in Module Pool you where using BU_DATE_CHAR use ZBU_DATE_CHAR
I did the above way and it is working fine this way now When i Press F4 and select some date it show in the Field like 01-01-2009 Previously it was showing me 01.01.2009
Please Reply if any problem,
Best Regards,
Faisal -
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,
hamzaHi,
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
Maybe you are looking for
-
I've been playing with lvoop for 4 or 5 months now, and in general I like it very much, but I've repeatedly wanted to build classes that know something about who owns them and I can't figure out how to make this happen. The simple example I've been t
-
Video is not playing in the latest version of shocwave
I have been getting calls from my users that tell me that videos will not show up since they updated their Shockwave. I have tested it here and with an older version of Shockwave, everything is fine but when I updated, the video no longer displayed.
-
Multiple customer statement in one spool file
Hi Experts, I am using f.27 to create a monthly customer statement. I would like to process all the customer in one time, which is able to create an spool request, but my requirement is to generate different pdf files from one spool file. Please help
-
Where to find readily-available high-res MBP 15' in Hong Kong ?
Hi, I need either a new or a refurb 15" MB in HK with a high-res anti-glare screen. Any ideas in which store I can find one? I tried DG but they only have the 2.8 CPU version that sells for HKD $23k, I'm looking for something that will cost me max. H
-
BBP_LOCATIONS_GET_ALL
Hi all We are using BBP_LOCATIONS_GET_ALL program but this error occurs: "Error Accessing System R3_D113" (Message no. BBP_LOCATION001). We check the RFC and it's OK (we test in SM59) We check the names of logic systems and it's OK We already test wi