Adding F4 help in table maintainace
*----------------------------------------------------------------------*
***INCLUDE LZHR_DHARMOFFF01.
*----------------------------------------------------------------------*
FORM get_org.
TYPES:
BEGIN OF ty_t527x,
orgeh TYPE orgeh,
orgtx TYPE orgtx,
END OF ty_t527x.
DATA:
lwa_t527x TYPE ty_t527x,
lt_t527x TYPE TABLE OF ty_t527x,
lt_retval TYPE TABLE OF ddshretval,
lwa_retval TYPE ddshretval,
lt_fields TYPE TABLE OF dynpread,
lwa_fields LIKE LINE OF lt_fields.
DATA:
lv_line TYPE string.
**Get Org Unit
SELECT SINGLE orgeh
orgtx FROM t527x INTO lwa_t527x WHERE sprsl = sy-langu AND
orgeh = zhr_dharmoff-orggh.
zhr_dharmoff-orgex = lwa_t527x-orgtx.
ENDFORM. "get_org
*---------------------------------------------------------------------*
* view related PAI modules
* generation date: 12.02.2015 at 15:21:28 by user ABAP05
* view maintenance generator version: #001407#
*---------------------------------------------------------------------*
INCLUDE lsvimitx . "base table related PAI modules
*----------------------------------------------------------------------*
* MODULE get_org
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
MODULE get_org.
TYPES:
BEGIN OF ty_t527x,
orgeh TYPE orgeh,
orgtx TYPE orgtx,
END OF ty_t527x.
DATA:
lwa_t527x TYPE ty_t527x,
lt_t527x TYPE TABLE OF ty_t527x,
lt_retval TYPE TABLE OF ddshretval,
lwa_retval TYPE ddshretval,
lt_fields TYPE TABLE OF dynpread,
lwa_fields LIKE LINE OF lt_fields.
data:
lv_line TYPE string.
**Get Org Unit
SELECT orgeh orgtx FROM t527x INTO TABLE lt_t527x WHERE sprsl = sy-langu.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'ORGEH'
value_org = 'S'
dynprofield = 'ORGEH'
TABLES
value_tab = lt_t527x
return_tab = lt_retval
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
READ TABLE lt_retval INTO lwa_retval INDEX 1.
get CURSOR LINE lv_line.
lwa_fields-fieldname = 'ZHR_DHARMOFF-ORGGH'.
lwa_fields-fieldvalue = lwa_retval-fieldval.
lwa_fields-STEPL = lv_line.
APPEND lwa_fields TO lt_fields.
CLEAR: lwa_fields.
READ TABLE lt_t527x INTO lwa_t527x WITH KEY orgeh = lwa_retval-fieldval.
lwa_fields-fieldname = 'ZHR_DHARMOFF-ORGEX'.
lwa_fields-fieldvalue = lwa_t527x-orgtx.
lwa_fields-STEPL = lv_line.
APPEND lwa_fields TO lt_fields.
CLEAR: lwa_fields.
IF lt_fields IS NOT INITIAL.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = sy-cprog
dynumb = sy-dynnr
TABLES
dynpfields = lt_fields
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.
ENDIF.
ENDMODULE. "get_org
*----------------------------------------------------------------------*
***INCLUDE LZHR_MAS_TIDI01.
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Module GET_PERSA INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE get_persa INPUT.
TYPES:
BEGIN OF ty_T500P,
PERSA TYPE persa,
name1 TYPE PBTXT,
END OF ty_T500P.
DATA:
lwa_T500P TYPE ty_T500P,
lt_T500P TYPE TABLE OF ty_T500P,
lt_retval TYPE TABLE OF ddshretval,
lwa_retval TYPE ddshretval,
lt_fields TYPE TABLE OF dynpread,
lwa_fields LIKE LINE OF lt_fields.
data:
lv_line TYPE string.
**Get employee subgroup
*break abap07.
SELECT PERSA NAME1 FROM T500P INTO TABLE lt_T500P. " WHERE sprsl = sy-langu.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'PERSA'
value_org = 'S'
dynprofield = 'PERSA'
TABLES
value_tab = lt_T500P
return_tab = lt_retval
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
READ TABLE lt_retval INTO lwa_retval INDEX 1.
get CURSOR LINE lv_line.
lwa_fields-fieldname = 'ZHR_MAS_TID-PERSA'.
lwa_fields-fieldvalue = lwa_retval-fieldval.
lwa_fields-STEPL = lv_line.
APPEND lwa_fields TO lt_fields.
CLEAR: lwa_fields.
READ TABLE lt_T500P INTO lwa_T500P WITH KEY PERSA = lwa_retval-fieldval.
lwa_fields-fieldname = 'ZHR_MAS_TID-NAME1'.
lwa_fields-fieldvalue = lwa_T500P-NAME1.
lwa_fields-STEPL = lv_line.
APPEND lwa_fields TO lt_fields.
CLEAR: lwa_fields.
IF lt_fields IS NOT INITIAL.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = sy-cprog
dynumb = sy-dynnr
TABLES
dynpfields = lt_fields
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.
ENDIF.
ENDMODULE. " GET_PERSA INPUT
*********************************************************************
*********************************************************************
*----------------------------------------------------------------------*
***INCLUDE LZHR_MAS_TIDI02.
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Module GET_BTRTL INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE get_btrtl INPUT.
TYPES:
BEGIN OF ty_T001P,
BTRTL TYPE BTRTL,
BTEXT TYPE PBTXT,
END OF ty_T001P.
DATA:
lwa_T001P TYPE ty_T001P,
lt_T001P TYPE TABLE OF ty_T001P,
lt_retval1 TYPE TABLE OF ddshretval,
lwa_retval1 TYPE ddshretval,
lt_fields1 TYPE TABLE OF dynpread,
lwa_fields1 LIKE LINE OF lt_fields1.
data:
lv_line1 TYPE string.
**Get employee subgroup
*break abap07.
SELECT BTRTL BTEXT FROM T001P INTO TABLE lt_T001P. " WHERE sprsl = sy-langu.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'BTRTL'
value_org = 'S'
dynprofield = 'BTRTL'
TABLES
value_tab = lt_T001P
return_tab = lt_retval1
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
READ TABLE lt_retval1 INTO lwa_retval1 INDEX 1.
get CURSOR LINE lv_line1.
lwa_fields1-fieldname = 'ZHR_MAS_TID-BTRTL'.
lwa_fields1-fieldvalue = lwa_retval1-fieldval.
lwa_fields1-STEPL = lv_line1.
APPEND lwa_fields1 TO lt_fields1.
CLEAR: lwa_fields1.
READ TABLE lt_T001P INTO lwa_T001P WITH KEY BTRTL = lwa_retval1-fieldval.
lwa_fields1-fieldname = 'ZHR_MAS_TID-BTEXT'.
lwa_fields1-fieldvalue = lwa_T001P-BTEXT.
lwa_fields1-STEPL = lv_line1.
APPEND lwa_fields1 TO lt_fields1.
CLEAR: lwa_fields1.
IF lt_fields1 IS NOT INITIAL.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = sy-cprog
dynumb = sy-dynnr
TABLES
dynpfields = lt_fields1
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.
ENDIF.
ENDMODULE. " GET_BTRTL INPUT
thank u!
ReplyDelete