Validation and substitute in SAP ABAP issue
irst of all you have to define your user exit in the FORM routine GET_EXIT_TITLES with the correct
exit type (EXITS-PARAM).
The exit type required for your FORM routine is C_EXIT_PARAM_CLASS A where complete type is transferred as a parameter.
Bear in mind that this exit type can only be used for callup points with complete documents (3).
Hereafter an example for your issue
exits-name = 'USDN'. exits-param = c_exit_param_class. exits-title = 'SDN Test 4 GSBER Substitution'. append exits. *&---------------------------------------------------------------------* *& USER EXIT USDN *&---------------------------------------------------------------------* * GSBER substitution *----------------------------------------------------------------------* form usdn using bool_data type gb002_015. data wa_bseg type bseg. loop at bool_data-bseg into wa_bseg where koart = 'K'. exit. endloop.. loop at bool_data-bseg into bseg where koart = 'T'. bseg-gsber = wa_bseg-gsber. modify bool_data-bseg from bseg. endloop. endform.
FORM RK001 USING bool_data TYPE gb002_015 "TYPE GB002_<boolean class of aspect 001>
CHANGING b_result.
* BREAK-POINT.
DATA: gv_dmbtr2 TYPE bseg-dmbtr,
gv_dmbtr1 TYPE bseg-dmbtr,
gv_netwr TYPE ekpo-netwr,
gv_sub TYPE bseg-dmbtr.
CLEAR: gv_dmbtr2,gv_dmbtr1.
DATA wa_bseg TYPE bseg.
LOOP AT bool_data-bseg INTO wa_bseg. "where koart = 'K'.
gv_dmbtr2 = gv_dmbtr2 + wa_bseg-dmbtr.
CLEAR: wa_bseg.
ENDLOOP.
READ TABLE bool_data-bseg INTO wa_bseg INDEX 1.
IF sy-subrc EQ 0.
SELECT dmbtr,ebeln FROM bseg INTO TABLE @DATA(gt_bseg) WHERE ebeln = @wa_bseg-ebeln.
IF sy-subrc EQ 0.
LOOP AT gt_bseg INTO DATA(gs_bseg).
gv_dmbtr1 = gv_dmbtr1 + gs_bseg-dmbtr.
CLEAR: gs_bseg.
ENDLOOP.
ENDIF.
SELECT ebeln,netwr FROM ekpo INTO TABLE @DATA(gt_ekpo) WHERE ebeln EQ @wa_bseg-ebeln.
IF sy-subrc EQ 0.
LOOP AT gt_ekpo INTO DATA(gs_ekpo).
gv_netwr = gv_netwr + gs_ekpo-netwr.
CLEAR: gs_ekpo.
ENDLOOP.
ENDIF.
ENDIF.
GV_SUB = GV_DMBTR2 + GV_DMBTR.
IF GV_SUB LE GV_NETWR.
ELSE.
MESSAGE 'Posting Amount Issue Pleae fix IT' TYPE 'E'.
ENDIF.
ENDFORM.
Comments
Post a Comment