cancel
Showing results for 
Search instead for 
Did you mean: 

#CoE#JYPE Apply substitute rule While using Manage Automatic Payment App.

JYPE
Discoverer
0 Kudos

 

 

Hi Community!

Clients want to enter TEXT in the Payment Document's text field (Header Text and Bank Line Text) created when running the Manage Automatic Payment App.


Is it possible to apply the ECC version of F110 payment document TEXT substition ABAP logic to Cloud ABAP logic?

I would appreciate it if you could let me know the applicable Cloud abap sample code.

-- ECC/PCE rule example --

*--------------------------------------------------------------------*

* FORM U300

*--------------------------------------------------------------------*

* Clearing A/P

*--------------------------------------------------------------------*

FORM U300 USING BOOL_DATA TYPE GB002_015.

* BOOL_DATA TYPE GB002_012.

* BOOL_DATA TYPE GB002_013.

 

DATA : BEGIN OF LT_DOC OCCURS 0,

BUKRS LIKE BSEG-BUKRS,

GJAHR LIKE BSEG-GJAHR,

BELNR LIKE BKPF-BELNR,

WRBTR LIKE BSEG-WRBTR,

END OF LT_DOC.

 

DATA : LV_STRU TYPE STRING,

LS_BSEG TYPE BSEG.

 

DATA : LV_BKTXT TYPE BKTXT.

 

FIELD-SYMBOLS: <FS_REGUH> TYPE REGUH.

 

 

CLEAR LV_BKTXT.

 

CHECK BKPF-BLART EQ 'ZP'.

CHECK BKPF-TCODE EQ 'F110'.

 

* LOGIC for reading Original Documents during AUTO PAYMENT

* Assign REGUH reference area in SAPF110S payment program

LV_STRU = '(SAPF110S)REGUH'.

 

ASSIGN (LV_STRU) TO <FS_REGUH>.

 

CHECK SY-SUBRC EQ 0.

 

CHECK <FS_REGUH> IS NOT INITIAL.

 

CLEAR : LT_DOC, LT_DOC[].

SELECT ZBUKR AS BUKRS

BELNR

GJAHR

WRBTR

INTO CORRESPONDING FIELDS OF TABLE LT_DOC

FROM REGUP

WHERE LAUFD EQ <FS_REGUH>-LAUFD

AND LAUFI EQ <FS_REGUH>-LAUFI.

 

SORT LT_DOC BY WRBTR DESCENDING.

 

READ TABLE LT_DOC INDEX 1.

CLEAR LV_BKTXT.

SELECT SINGLE BKTXT

INTO LV_BKTXT

FROM BKPF

WHERE BUKRS EQ LT_DOC-BUKRS

AND BELNR EQ LT_DOC-BELNR

AND GJAHR EQ LT_DOC-GJAHR.

 

MOVE LV_BKTXT TO BKPF-BKTXT.

 

LOOP AT BOOL_DATA-BSEG INTO LS_BSEG.

MOVE LV_BKTXT TO LS_BSEG-SGTXT.

MODIFY BOOL_DATA-BSEG FROM LS_BSEG.

CLEAR LS_BSEG.

ENDLOOP.

 

ENDFORM. "U300

 

refence URL: <https://adonishansap.blogspot.com/2017/02/zrggbs000.html>

View Entire Topic
Cora_Phelan
Product and Topic Expert
Product and Topic Expert
0 Kudos

You can create substitutions and validations