0

I'm trying to post document through tcode FF_5 (electronic bank statements) as SWIFT MT940 - international format, with immediate posting parameter. Bank Accounting Posting works fine, but Subledger posting doesn't work correctly.

After debugging I found information that document is being posted by FM: 'POSTING_INTERFACE_DOCUMENT'. Inside return table - t_bapiret2 I'm getting message "Batch Input for screen SAPLFCPD 0100 does not exist" (Type: S, ID: 00, NR: 344). When I'm trying to post this without background processing I have to insert name of customer into field BSEC-NAME1 of this screen and it posts fine.

I want to automize this process. How should I pass data to ftpost[] or bdcdata[] tables to inject information about Customer Name? I tried to do it in various ways in debugging mode but none of them worked for me.

Sample BDCDATA[] record that I created:

ft-program = 'SAPLFCPD'.
ft-dynpro = '0100'.
ft-dynbegin = 'X'.
APPEND ft.
CLEAR ft.
ft-fname = 'BSEC-NAME1'.
ft-fval = 'TEST'.
APPEND ft.

EDIT: Sample bank statement:


:20:MT940
:25:/PL22112110212000180204832110
:28C:56
:60F:C220525PLN89107,30
:61:2205250525D269,98N152NONREF//6450501100324535
152 0
:86:020~00152
~20ZAM.PL111111111, FVKOR/0022
~2111/2205/2401120
~22˙
~23˙
~24˙
~25˙
~3010202964
~310000620200678839
~32CUSTOMER NAME
~33˙
~38PL23102029640000620200678839
~60˙
~63˙
:62F:C220525PLN88837,32
:64:C220525PLN88837,32
-

This is one-time Client, he has no master data information that's why I want to inject it.

I would really appreciate any help.


I added some code to process it as BDC, right now entries are available in SM35. Code looks like this:

ENHANCEMENT 1  ES_BDC_FEBAN.    "active version
  data lv_session TYPE APQI-GROUPID.
  lv_session   = |{ SY-DATUM }{ SY-TIMLO(4) }|.

       DATA: lv_name1 LIKE bsec-name1.
       GET PARAMETER ID 'FEBAN_NAME1' FIELD lv_name1.
       IF lv_name1 IS NOT INITIAL.
         CALL FUNCTION 'BDC_OPEN_GROUP'
           EXPORTING
             client              = SY-MANDT         " Client
             group               = LV_SESSION         " Session name
             keep                = 'X'          " Indicator to keep processed sessions
             user                = SY-UNAME     " Batch input user
           EXCEPTIONS
             client_invalid      = 1                " Client is invalid
             destination_invalid = 2                " Target system is invalid/no longer relevant
             group_invalid       = 3                " Batch input session name is invalid
             group_is_locked     = 4                " Batch input session is protected elsewhere
             holddate_invalid    = 5                " Lock date is invalid
             internal_error      = 6                " Internal error of batch input (see SYSLOG)
             queue_error         = 7                " Error reading/writing the queue (see SYSLOG)
             running             = 8                " Session is already being processed
             system_lock_error   = 9                " System error when protecting BI session
             user_invalid        = 10               " BI user is not valid
             others              = 11
           .
         IF SY-SUBRC <> 0.

         ENDIF.

         MODE = 'Q'.

         clear: FUNCT, SGFUNCT.
*          funct = 'B'.
*          SGFUNCT = 'B'.

            ft-program = 'SAPLFCPD'.
            ft-dynpro = '0100'.
            ft-dynbegin = 'X'.
            APPEND ft TO ft[].
            CLEAR: ft-program, ft-dynpro, ft-dynbegin.
            ft-fnam = 'BSEC-NAME1'.
            ft-fval = lv_name1.
            APPEND ft TO ft[].

                  CALL FUNCTION 'BDC_INSERT'
        EXPORTING
          tcode     = tcode
        TABLES
          dynprotab = ft.

       call function 'BDC_CLOSE_GROUP' .

       COMMIT WORK AND WAIT.

       SUBMIT RSBDCSUB EXPORTING LIST TO MEMORY
         WITH mappe    EQ lv_session
         WITH von      EQ sy-datum
         WITH bis      EQ sy-datum
         WITH z_verarb EQ 'X'
         WITH fehler   EQ ''
         WITH logall   EQ 'X'
         AND RETURN.

       ENDIF.

ENDENHANCEMENT.

Variables entries: Tcode = 'FB01' FT[]:

<asx:abap version="1.0" xmlns:asx="http://www.sap.com/abapxml"><asx:values><_--5CTYPE_--3D_--25_T00004S00000371O0000147040><item><PROGRAM>SAPMF05A</PROGRAM><DYNPRO>0100</DYNPRO><DYNBEGIN>X</DYNBEGIN><FNAM/><FVAL/></item><item><PROGRAM/><DYNPRO>0000</DYNPRO><DYNBEGIN/><FNAM>BDC_CURSOR</FNAM><FVAL>RF05A-NEWKO</FVAL></item><item><PROGRAM/><DYNPRO>0000</DYNPRO><DYNBEGIN/><FNAM>BKPF-BLDAT</FNAM><FVAL>25.05.2022</FVAL></item><item><PROGRAM/><DYNPRO>0000</DYNPRO><DYNBEGIN/><FNAM>BKPF-BLART</FNAM><FVAL>WB</FVAL></item><item><PROGRAM/><DYNPRO>0000</DYNPRO><DYNBEGIN/><FNAM>BKPF-BUKRS</FNAM><FVAL>1700</FVAL></item><item><PROGRAM/><DYNPRO>0000</DYNPRO><DYNBEGIN/><FNAM>BKPF-BUDAT</FNAM><FVAL>25.05.2022</FVAL></item><item><PROGRAM/><DYNPRO>0000</DYNPRO><DYNBEGIN/><FNAM>BKPF-WAERS</FNAM><FVAL>PLN</FVAL></item><item><PROGRAM/><DYNPRO>0000</DYNPRO><DYNBEGIN/><FNAM>BKPF-XBLNR</FNAM><FVAL>PBE01PL41022056</FVAL></item><item><PROGRAM/><DYNPRO>0000</DYNPRO><DYNBEGIN/><FNAM>BKPF-BKTXT</FNAM><FVAL>0000375800001</FVAL></item><item><PROGRAM/><DYNPRO>0000</DYNPRO><DYNBEGIN/><FNAM>RF05A-NEWBS</FNAM><FVAL>40</FVAL></item><item><PROGRAM/><DYNPRO>0000</DYNPRO><DYNBEGIN/><FNAM>RF05A-NEWKO</FNAM><FVAL>1232000000</FVAL></item><item><PROGRAM>SAPMF05A</PROGRAM><DYNPRO>0300</DYNPRO><DYNBEGIN>X</DYNBEGIN><FNAM/><FVAL/></item><item><PROGRAM/><DYNPRO>0000</DYNPRO><DYNBEGIN/><FNAM>BSEG-WRBTR</FNAM><FVAL>269,98</FVAL></item><item><PROGRAM/><DYNPRO>0000</DYNPRO><DYNBEGIN/><FNAM>BSEG-VALUT</FNAM><FVAL>25.05.2022</FVAL></item><item><PROGRAM/><DYNPRO>0000</DYNPRO><DYNBEGIN/><FNAM>BSEG-ZUONR</FNAM><FVAL>0000375800001PLN</FVAL></item><item><PROGRAM/><DYNPRO>0000</DYNPRO><DYNBEGIN/><FNAM>BSEG-SGTXT</FNAM><FVAL>NONREF 020152 ZAM.PL146751217, FVKOR/002211/2205/2</FVAL></item><item><PROGRAM/><DYNPRO>0000</DYNPRO><DYNBEGIN/><FNAM>BDC_CURSOR</FNAM><FVAL>RF05A-NEWKO</FVAL></item><item><PROGRAM/><DYNPRO>0000</DYNPRO><DYNBEGIN/><FNAM>RF05A-NEWBS</FNAM><FVAL>50</FVAL></item><item><PROGRAM/><DYNPRO>0000</DYNPRO><DYNBEGIN/><FNAM>RF05A-NEWKO</FNAM><FVAL>1430101010</FVAL></item><item><PROGRAM>SAPLKACB</PROGRAM><DYNPRO>0002</DYNPRO><DYNBEGIN>X</DYNBEGIN><FNAM/><FVAL/></item><item><PROGRAM/><DYNPRO>0000</DYNPRO><DYNBEGIN/><FNAM>BDC_OKCODE</FNAM><FVAL>/00</FVAL></item><item><PROGRAM>SAPMF05A</PROGRAM><DYNPRO>0300</DYNPRO><DYNBEGIN>X</DYNBEGIN><FNAM/><FVAL/></item><item><PROGRAM/><DYNPRO>0000</DYNPRO><DYNBEGIN/><FNAM>BSEG-WRBTR</FNAM><FVAL>269,98</FVAL></item><item><PROGRAM/><DYNPRO>0000</DYNPRO><DYNBEGIN/><FNAM>BSEG-VALUT</FNAM><FVAL>25.05.2022</FVAL></item><item><PROGRAM/><DYNPRO>0000</DYNPRO><DYNBEGIN/><FNAM>BSEG-ZUONR</FNAM><FVAL>PL1467512</FVAL></item><item><PROGRAM/><DYNPRO>0000</DYNPRO><DYNBEGIN/><FNAM>BSEG-SGTXT</FNAM><FVAL>NONREF 020152 ZAM.PL111111111, FVKOR/002211/2205/2</FVAL></item><item><PROGRAM/><DYNPRO>0000</DYNPRO><DYNBEGIN/><FNAM>BDC_CURSOR</FNAM><FVAL>RF05A-NEWKO</FVAL></item><item><PROGRAM/><DYNPRO>0000</DYNPRO><DYNBEGIN/><FNAM>BDC_OKCODE</FNAM><FVAL>/11</FVAL></item><item><PROGRAM>SAPLKACB</PROGRAM><DYNPRO>0002</DYNPRO><DYNBEGIN>X</DYNBEGIN><FNAM/><FVAL/></item><item><PROGRAM/><DYNPRO>0000</DYNPRO><DYNBEGIN/><FNAM>BDC_OKCODE</FNAM><FVAL>/00</FVAL></item><item><PROGRAM>SAPLFCPD</PROGRAM><DYNPRO>0100</DYNPRO><DYNBEGIN>X</DYNBEGIN><FNAM/><FVAL/></item><item><PROGRAM/><DYNPRO>0000</DYNPRO><DYNBEGIN/><FNAM>BSEC-NAME1</FNAM><FVAL>CUSTOMER NAME</FVAL></item></_--5CTYPE_--3D_--25_T00004S00000371O0000147040></asx:values></asx:abap>

Data might looks slightly differently from debugger and bank statement.

There are 2 entries in SM35, first is processed correctly, but 2nd one has log entries like this: Logs

Can somebody help me please?

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
TyRRRax
  • 55
  • 11
  • It is hard to help not knowing the file you want to import. I have looked at this function module. SAP indeed uses there Batch Input internally, which makes it even more awkward that they forgot to put the data for the aforementioned screen there. I think the best way for you would be to go with a OSS message (although I think it is called an incident nowadays). – Jagger Jun 15 '22 at 07:36
  • `It is hard to help not knowing the file you want to import` agree. Post the file, plz. You shouldn't debug and simulate the internal input of standard transactions, like you are doing here, if the `FF_5` doesn't work for you it's either you file is wrong, or FF_5 is wrong, which indeed requres an incident, like mentioned by Jagger – Suncatcher Jun 15 '22 at 08:27
  • @Jagger Edited my post as you asked. Important things is fact that's one-time Client that has no masterdata. – TyRRRax Jun 15 '22 at 08:32
  • @Suncatcher can u help me with this? I posted bank statement that I'm uploading – TyRRRax Jun 17 '22 at 06:19
  • `but Subledger posting doesn't work correctly` what it means? it doesn't post silently or throwing any error? have you defined the [posting rules](https://i0.wp.com/aumtechsolutions.com/wp-content/uploads/2019/12/Image-8-1.png) for the correspondent bank in `V_T033F_EBST` and `V_T033F_EBST` views? bank stmt import requires plenty of customizing in SPRO->Financial Accounting->Bank Accounting->Business Transactions->Payment Transactions->Electronic Bank Statement – Suncatcher Jun 17 '22 at 10:41
  • also I see your 25 tag is incorrect, it should be `:25:PL22112110/212000180204832110` following the `:25: Account Identification Bank ID/account number` format, w/o any slashes. Though it may be Poland-dependent format – Suncatcher Jun 17 '22 at 10:45
  • @Suncatcher it means that when I'm trying to post document in background mode it's beeing posted succesfully on Bank Accounting but on Subledger there's a failure. When I post it through FEBAN tcode there's a success on both types of accounts (but first I have to fill BSEC-NAME1 field on screen 0100 from program SAPLFCPD). – TyRRRax Jun 20 '22 at 07:23
  • @Suncatcher posting rules are defined correctly, FI consultant double checked it. It doesn't post silently. – TyRRRax Jun 20 '22 at 13:19

2 Answers2

0

Most likely you are confusing working principles of FEBAN and FF_5.

In SM35 you will see BI sessions created by FF_5. You need to process them to post real postings.

Also I recommend to retry the failed postings via FEBP transaction, which is called by FF_5 under the hood. It does almost the same as FF_5, and uses FF_5 data, but has the ability to repost the failed records.

The one interesting parameter FEBP has is Bk Pstg Only "Only post to G/L", which may be setting silently by FF_5 which may prevent you to post to subledgers. Though I can't confirm this, it's only assumption.

enter image description here

P.S. Also I recommend to never ever change automatically generated batch sessions like you do, not SAPLFCPD nor any others.

Suncatcher
  • 10,355
  • 10
  • 52
  • 90
0

Problem solved. I passed records in ft[] in wrong order. Very usefull thing is using tcode SHDB as simulation how records should be passed. At my case FT[] table should contain

SAPMF05A scr. 0100
[... required fields ...] 
SAPLFCPD scr. 0100
BSEC-NAME1   <-- Injected missing field 
SAPMF05A scr. 0300
[... required fields ...]
SAPMF05A SCR. 0301 
[... required fields ... -> SAVE]

Topic can be closed. Thank you.

TyRRRax
  • 55
  • 11