Friday, March 16, 2012

Debug Popup Window

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                                                      

In sm30 add description column which is not a table fields

In se80 function group:

# Declaration in top include.

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

Hide table control columns

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.

Converting number to character variable with write statement

DATA : lv_stot TYPE konv-kbetr.
DATA : lv_stot1(50).
DATA : lv_stot2 TYPE konv-kbetr.
DATA : lv_stot3(50).

REPLACE ALL OCCURRENCES OF ',' IN lv_stot1 WITH space.
lv_stot2 = lv_stot1 + lv_stot.
WRITE lv_stot2 TO lv_stot3.

AT SELECTION-SCREEN OUTPUT hide fields

LOOP AT SCREEN.
IF p_static = 'X'.
IF screen-name = 'S_PRODID-LOW' OR
screen-name = 'S_PRODID-HIGH' OR
screen-name = '%_S_PRODID_%_APP_%-TEXT' OR
screen-name = '%_S_PRODID_%_APP_%-OPTI_PUSH' OR
screen-name = '%_S_PRODID_%_APP_%-TO_TEXT' OR
screen-name = '%_S_PRODID_%_APP_%-VALU_PUSH' .
screen-active = 1.
screen-invisible = 0.
screen-input = 1.
screen-output = 1.
MODIFY SCREEN.
ENDIF.
else.
IF screen-name = 'S_PRODID-LOW' OR
screen-name = 'S_PRODID-HIGH' OR
screen-name = '%_S_PRODID_%_APP_%-TEXT' OR
screen-name = '%_S_PRODID_%_APP_%-OPTI_PUSH' OR
screen-name = '%_S_PRODID_%_APP_%-TO_TEXT' OR
screen-name = '%_S_PRODID_%_APP_%-VALU_PUSH' .
screen-invisible = 1.
screen-input = 0.
screen-output = 0.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDIF.
ENDLOOP.

Forced call fcode or ucomm

CALL METHOD cl_gui_cfw=>set_new_ok_code

EXPORTING
new_code = 'REFRESH'

Thursday, March 15, 2012

Update checkbox value in internal table of ALV

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.