Code: Alles auswählen.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_bps_to.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'PARTNER'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'P_BPS_TO'
value_org = 'S'
TABLES
value_tab = lt_bpid
return_tab = lt_return_to
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.
READ TABLE lt_return_to INTO ls_return_to INDEX 1.
lv_partner_to = ls_return_to-fieldval.
IF lv_partner_to IS NOT INITIAL.
CLEAR t_bps_to.
CLEAR ls_name.
SELECT SINGLE but000~name_first but000~name_last INTO ls_name
FROM but000
INNER JOIN but100 ON but000~partner = but100~partner
WHERE but100~partner = lv_partner_to.
CONCATENATE ls_name-name_first ` ` ls_name-name_last INTO t_bps_to.
SUPPRESS DIALOG. "Fire PAI
ENDIF.
cschmoel hat geschrieben:Ich hoffe die Erklärungen reicht bis hier hin mal und fände es super wenn mir da jemand helden könnte
Code: Alles auswählen.
INITIALIZATION.
IF P_BPS_TO IS NOT INITIAL.
CLEAR t_bps_to.
CLEAR ls_name.
SELECT SINGLE but000~name_first but000~name_last INTO ls_name
FROM but000
INNER JOIN but100 ON but000~partner = but100~partner
WHERE but100~partner = lv_partner_to.
CONCATENATE ls_name-name_first ` ` ls_name-name_last INTO t_bps_to.
ENDIF.
Code: Alles auswählen.
DATA lt_return TYPE STANDARD TABLE OF ddshretval.
DATA ls_return TYPE ddshretval.
DATA lt_t001w TYPE STANDARD TABLE OF t001w.
DATA ls_t001w TYPE t001w.
PARAMETERS p_werks TYPE werks_d.
PARAMETERS p_wname TYPE name1 MODIF ID dis.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-group1 = 'DIS'.
screen-input = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
INITIALIZATION.
SELECT * FROM t001w INTO TABLE lt_t001w UP TO 10 ROWS.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_werks.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'WERKS'
dynpprog = sy-cprog
dynpnr = sy-dynnr
dynprofield = 'P_WERKS'
value_org = 'S'
TABLES
value_tab = lt_t001w
return_tab = lt_return
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.
ELSE.
READ TABLE lt_return INTO ls_return INDEX 1.
READ TABLE lt_t001w INTO ls_t001w INDEX ls_return-recordpos.
p_wname = ls_t001w-name1.
CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE'
EXPORTING
functioncode = '=00'.
ENDIF.
START-OF-SELECTION.
WRITE: ls_t001w-name1.
Code: Alles auswählen.
READ TABLE lt_t001w INTO ls_t001w INDEX ls_return-recordpos.
Code: Alles auswählen.
READ TABLE lt_t001w INTO ls_t001w with key werks = ls_return-fieldval.