ENHANCEMENT 1 ZMB_VENDOR_POP_UP. "active version
IF sy-tcode EQ 'MB21' OR sy-tcode EQ 'MB22'.
DATA:
it_resb TYPE STANDARD TABLE OF sval,
wa_resb TYPE sval,
it_resb_ext TYPE STANDARD TABLE OF resb,
lv_lifnr TYPE resb-lifnr.
IF it_resb IS INITIAL.
wa_resb-tabname = 'RESB'.
wa_resb-fieldname = 'LIFNR'.
IF xresb-lifnr IS NOT INITIAL.
*--Display Vendor--*
wa_resb-value = xresb-lifnr.
ENDIF.
APPEND wa_resb TO it_resb.
ENDIF.
*--Pop up for Vendor--*
CALL FUNCTION 'POPUP_GET_VALUES'
EXPORTING
popup_title = 'Select Vendor'
tables
fields = it_resb
EXCEPTIONS
ERROR_IN_FIELDS = 1
OTHERS = 2 .
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
READ TABLE it_resb ASSIGNING FIELD-SYMBOL(<fs_resb>) INDEX 1.
*--Fill the Vendor in RESB--*
IF sy-subrc IS INITIAL.
lv_lifnr = <fs_resb>-value.
ENDIF.
IF xresb IS NOT INITIAL.
LOOP AT xresb ASSIGNING FIELD-SYMBOL(<fs_xresbz>).
IF lv_lifnr IS NOT INITIAL.
<fs_xresbz>-lifnr = lv_lifnr.
ENDIF.
ENDLOOP.
ENDIF.
*--For No change--*
IF upd_resb IS INITIAL AND upd_rkpf IS INITIAL AND
new_resb IS INITIAL AND sy-tcode EQ 'MB22'.
IF xresb-rsnum IS NOT INITIAL.
SELECT
*
FROM resb
INTO TABLE it_resb_ext
WHERE rsnum = xresb-rsnum.
IF sy-subrc IS INITIAL.
LOOP AT it_resb_ext ASSIGNING FIELD-SYMBOL(<fs_resb_update>).
IF <fs_resb_update>-lifnr NE lv_lifnr.
<fs_resb_update>-lifnr = lv_lifnr.
*--Update the Vendor--*
UPDATE resb SET lifnr = <fs_resb_update>-lifnr
WHERE rsnum EQ <fs_resb_update>-rsnum
AND rspos EQ <fs_resb_update>-rspos
AND rsart EQ <fs_resb_update>-rsart.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDENHANCEMENT.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
3 | |
3 | |
2 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 |