To debug a popup, create a text file on your local computer with following code, Place file on your desktop. To debug a popup drag and drop this file over the popup.
Code:
[FUNCTION]
Command=/H
Title=Debugger
Type=SystemCommand
Code:
[FUNCTION]
Command=/H
Title=Debugger
Type=SystemCommand
In se80 function group:
data : gv_mat_DESC type string.
# Add one column in layout.:column Name gv_mat_DESC
# In PBO
inside loop add one module .: module get_desc.
module GET_DESC output.
IF zct_stage_prod-BY_PROD is not initial.
select single maktx into gv_mat_DESC
from makt client specified
where mandt = sy-mandt
and matnr = zct_stage_prod-BY_PROD.
ENDIF.
endmodule. " GET_DESC OUTPUT
module zhide_fields output.
data : ls_line like line of tctrl_ztps_rept_hdr-cols.
loop at tctrl_ztps_rept_hdr-cols into ls_line.
case sy-tabix.
when '8'.
ls_line-invisible = 1.
modify tctrl_ztps_rept_hdr-cols from ls_line.
when '9'.
ls_line-invisible = 1.
modify tctrl_ztps_rept_hdr-cols from ls_line.
when '10'.
ls_line-invisible = 1.
modify tctrl_ztps_rept_hdr-cols from ls_line.
endcase.
endloop.
endmodule.
CALL METHOD cl_gui_cfw=>set_new_ok_code
EXPORTING
new_code = 'REFRESH'
Data ref1 type ref to cl_gui_alv_grid.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
E_GRID = ref1.
call method ref1->check_changed_data.
# in SE37 create Z conversion Exit->
"CONVERSION_EXT_ZSIGN_OUTPUT"
function conversion_exit_zsign_output.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(INPUT)
*" EXPORTING
*" REFERENCE(OUTPUT)
*"----------------------------------------------------------------------
data: lv_value type char30.
lv_value = input.
* Fm to display sign at front it returns value in char
call function 'CLOI_PUT_SIGN_IN_FRONT'
changing
value = lv_value
.
output = lv_value.
endfunction.
In Fieldcat of ALV use:
gs_lvc_s_fcat-edit_mask = '==ZSIGN'.
MODULE f4help INPUT.
DATA: v_dynindex LIKE sy-stepl.
DATA: lt_dynpread TYPE TABLE OF dynpread,
ls_dynpread TYPE dynpread.
DATA: lt_lictyp TYPE TABLE OF zty_lictyp,
ls_lictyp TYPE zty_lictyp.
CALL FUNCTION 'DYNP_GET_STEPL'
IMPORTING
povstepl = v_dynindex
EXCEPTIONS
stepl_not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ls_dynpread-stepl = v_dynindex.
ls_dynpread-fieldname = 'ZTPS_STRUCT-VBELN'.
APPEND ls_dynpread TO lt_dynpread.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-repid
dynumb = sy-dynnr
* 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 = lt_dynpread
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.
REFRESH lt_lictyp.
SELECT vbak~vbeln vbap~posnr vbap~matnr makt~maktx vbap~netwr
INTO CORRESPONDING FIELDS OF TABLE lt_lictyp
FROM ( vbak
INNER JOIN vbap
ON vbap~mandt = vbak~mandt
AND vbap~vbeln = vbak~vbeln
INNER JOIN makt
ON makt~mandt = vbap~mandt
AND makt~matnr = vbap~matnr )
WHERE vbak~mandt = sy-mandt
AND vbak~kunnr = ztps_rept_hdr-kunnr
AND spras = 'EN'.
DATA: lt_return TYPE TABLE OF ddshretval,
ls_return TYPE ddshretval.
DATA: lt_field_tab TYPE TABLE OF dfies.
DATA: lt_dselc TYPE TABLE OF dselc.
REFRESH: lt_field_tab, lt_return, lt_dselc.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
ddic_structure = 'ZTY_LICTYP'
retfield = 'VBELN'
* PVALKEY = ' '
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'ZTPS_STRUCT-VBELN'
* STEPL = 0
* WINDOW_TITLE =
* VALUE = ' '
value_org = 'S'
* multiple_choice = 'X'
* DISPLAY = ' '
callback_program = sy-repid
callback_form = 'CALLBACK_F4'
* MARK_TAB =
* IMPORTING
* USER_RESET =
TABLES
value_tab = lt_lictyp
field_tab = lt_field_tab
return_tab = lt_return
dynpfld_mapping = lt_dselc
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3
.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
DATA: dynpfields LIKE dynpread OCCURS 5 WITH HEADER LINE.
DATA: l_stepl LIKE sy-stepl.
REFRESH dynpfields.
CLEAR dynpfields.
READ TABLE lt_return INTO ls_return WITH KEY fieldname = 'VBELN'.
IF sy-subrc = 0.
ztps_struct-vbeln = ls_return-fieldval.
ENDIF.
READ TABLE lt_return INTO ls_return WITH KEY fieldname = 'POSNR'.
IF sy-subrc = 0.
dynpfields-fieldname = 'ZTPS_STRUCT-POSNR'. "Screen field name
dynpfields-fieldvalue = ls_return-fieldval. "New value
dynpfields-stepl = v_dynindex. "l_stepl "Step loop for table controls
APPEND dynpfields.
ENDIF.
READ TABLE lt_return INTO ls_return WITH KEY fieldname = 'MATNR'.
IF sy-subrc = 0.
dynpfields-fieldname = 'ZTPS_STRUCT-MATNR'. "Screen field name
dynpfields-fieldvalue = ls_return-fieldval. "New value
dynpfields-stepl = v_dynindex."l_stepl. "Step loop for table controls
APPEND dynpfields.
ENDIF.
READ TABLE lt_return INTO ls_return WITH KEY fieldname = 'MAKTX'.
IF sy-subrc = 0.
dynpfields-fieldname = 'ZTPS_STRUCT-MAKTX'. "Screen field name
dynpfields-fieldvalue = ls_return-fieldval. "New value
dynpfields-stepl = v_dynindex."l_stepl. "Step loop for table controls
APPEND dynpfields.
* ztps_struct-maktx = ls_return-fieldval.
ENDIF.
READ TABLE lt_return INTO ls_return WITH KEY fieldname = 'NETWR'.
IF sy-subrc = 0.
dynpfields-fieldname = 'ZTPS_STRUCT-NETWR'. "Screen field name
dynpfields-fieldvalue = ls_return-fieldval. "New value
dynpfields-stepl = v_dynindex."l_stepl. "Step loop for table controls
APPEND dynpfields.
ENDIF.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = sy-repid
dynumb = sy-dynnr
TABLES
dynpfields = dynpfields
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
undefind_error = 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.
ENDMODULE. " F4HELP INPUT
FORM callback_f4 TABLES record_tab STRUCTURE seahlpres
CHANGING shlp TYPE shlp_descr
callcontrol LIKE ddshf4ctrl.
* define local data
DATA:
ls_intf LIKE LINE OF shlp-interface,
ls_prop LIKE LINE OF shlp-fieldprop.
" Hide unwanted fields
CLEAR: ls_prop-shlpselpos,
ls_prop-shlplispos.
" Overwrite selectable fields on search help
REFRESH: shlp-interface.
ls_intf-shlpfield = 'VBELN'.
ls_intf-valfield = 'X'.
APPEND ls_intf TO shlp-interface.
ls_intf-shlpfield = 'POSNR'.
ls_intf-valfield = 'X'.
APPEND ls_intf TO shlp-interface.
ls_intf-shlpfield = 'MATNR'.
ls_intf-valfield = 'X'.
APPEND ls_intf TO shlp-interface.
ls_intf-shlpfield = 'MAKTX'.
ls_intf-valfield = 'X'.
APPEND ls_intf TO shlp-interface.
ls_intf-shlpfield = 'NETWR'.
ls_intf-valfield = 'X'.
APPEND ls_intf TO shlp-interface.
ENDFORM. " CALLBACK_F4