Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BDC return message problem

Former Member
0 Likes
7,112

Hello ABAPers;

In our system, we are using

"perform bdc_transaction using 'F-36'."

and in

    CALL TRANSACTION TCODE USING BDCDATA

                     MODE   CTUMODE

                     UPDATE CUPDATE

                     MESSAGES INTO MESSTAB.

My message tab which is MESSTAB returns empty and I get MESSAGE_TYPE_UNKNOWN error.

Program works and create what it supposed to create however we get dump now with MESSAGE_TYPE_UNKNOWN.

Anyone knows what the problem is?

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
5,366

Thanks for all of you guys for all your efforts but the problem cleared up in a very surprising way for me. We have checked the dates when this incident started and looked out for the requests on that time and it seems there has been a repair for F-55 and F-38 which was a "commit work". We have commented it and now all FI messages are working!

I dont know how is that happened because I put a break-point to that commit work line and in debug, system doesnt even get there

How a system gets effected when it doesnt actually go to that line on debug? Thats a mistery for me now...

Thanks for all of you again.

Talha

21 REPLIES 21
Read only

Former Member
0 Likes
5,366

Hi Talha,

Have you checked the type of messtab?:

  DATA messtab TYPE TABLE OF bdcmsgcoll WITH HEADER LINE

Regards

Read only

former_member213851
Active Contributor
0 Likes
5,366

Hi,

You are getting message table blank as the CALL Transaction is not returning any message no detaisl into  MESSTAB. To overcome this , populate MESSTAB with some default values like 'Others' so that dump will not occur.

Read only

deependra_shekhawat3
Contributor
0 Likes
5,366

Hi Tulha,

Do like this ....

    CALL TRANSACTION TCODE USING BDCDATA
                     MODE   CTUMODE
                     UPDATE CUPDATE
                     MESSAGES INTO MESSTAB.

IF    NOT  MESSTAB IS INITAIL.

      ******

------

      Call FM 'FORMAT_MESSAGE'

----

  ********

ENDIF.

THnaks,

Deeps

Read only

Former Member
0 Likes
5,366

to ;

Yes, that how I defined it.

to Sachin Adak and Deependra Shekhawat;

Thats the way that I have thought but it should not be the solution. Because Why i make up a message while it actually exists!? My problem is, the message is there somewhere and it can be S or E or W or I however I dont know why I cant get any messages to my MESSTAB.

F-36 does its job correctly and I should get a successful message to my MESSTAB, so can anyone tell me why I cant?

Thanks

Read only

0 Likes
5,366

Check screen process in Error Mode 'E'.

i think u r getiing sort dump.

Deeps

IF Still u get same ... Paste your call transaction code here

Read only

0 Likes
5,366

I processed my screen with "A" and there was nothing wrong. I dont get error, as I have told before my program actually works fine, does what it supposed to does. But the program get terminated with a dump before it finishes successfully.

That dump is MESSAGE_TYPE_UNKNOWN and it happens because MESSTAB is empty. I have checked the MESSTAB in debug mode.

My code is like this:

perform bdc_transaction using 'F-36'.

FORM BDC_TRANSACTION USING TCODE.

  DATA: L_MSTRING(480).

  DATA: L_SUBRC LIKE SY-SUBRC.

    REFRESH MESSTAB.

    CALL TRANSACTION TCODE USING BDCDATA
                     MODE   CTUMODE
                     UPDATE CUPDATE
                     MESSAGES INTO MESSTAB.

    L_SUBRC = SY-SUBRC.

    IF SMALLLOG <> 'X'.


      LOOP AT MESSTAB.

        SELECT SINGLE * FROM T100 WHERE SPRSL = MESSTAB-MSGSPRA
                                  AND   ARBGB = MESSTAB-MSGID
                                  AND   MSGNR = MESSTAB-MSGNR.

        IF SY-SUBRC = 0.

          L_MSTRING = T100-TEXT.

          IF L_MSTRING CS '&1'.

            REPLACE '&1' WITH MESSTAB-MSGV1 INTO L_MSTRING.
            REPLACE '&2' WITH MESSTAB-MSGV2 INTO L_MSTRING.
            REPLACE '&3' WITH MESSTAB-MSGV3 INTO L_MSTRING.
            REPLACE '&4' WITH MESSTAB-MSGV4 INTO L_MSTRING.

          ELSE.

            REPLACE '&' WITH MESSTAB-MSGV1 INTO L_MSTRING.
            REPLACE '&' WITH MESSTAB-MSGV2 INTO L_MSTRING.
            REPLACE '&' WITH MESSTAB-MSGV3 INTO L_MSTRING.
            REPLACE '&' WITH MESSTAB-MSGV4 INTO L_MSTRING.

          ENDIF.

          CONDENSE L_MSTRING.

          WRITE: / MESSTAB-MSGTYP, L_MSTRING(250).

        ELSE.

          WRITE: / MESSTAB.

       ENDIF.
      ENDLOOP.
      SKIP.
    ENDIF.

** Erzeugen fehlermappe ************************************************

    IF L_SUBRC <> 0 AND E_GROUP <> SPACE.

      IF E_GROUP_OPENED = ' '.

        CALL FUNCTION 'BDC_OPEN_GROUP'

             EXPORTING  CLIENT   = SY-MANDT
                        GROUP    = E_GROUP
                        USER     = E_USER
                        KEEP     = E_KEEP
                       HOLDDATE = E_HDATE.


         E_GROUP_OPENED = 'X'.

      ENDIF.

      CALL FUNCTION 'BDC_INSERT'

           EXPORTING TCODE     = TCODE

           TABLES    DYNPROTAB = BDCDATA.

    ENDIF.
  REFRESH BDCDATA.
ENDFORM.

Read only

0 Likes
5,366

That dump is MESSAGE_TYPE_UNKNOWN and it happens because MESSTAB is empty. I have checked the MESSTAB in debug mode.

Like what you've said, it happens if MESSTAB is empty. I suggest, check MESSTAB if initial or not before you do your loop on it. Maybe in this way, the error message will prevent.

Jake.

Read only

0 Likes
5,366

You can simplify your code as follows, but I do not think this will resolve your problem:

FORM BDC_TRANSACTION USING TCODE.

  DATA: L_MSTRING(480).

  DATA: L_SUBRC LIKE SY-SUBRC.

    REFRESH MESSTAB.

    CALL TRANSACTION TCODE USING BDCDATA
                     MODE   CTUMODE
                     UPDATE CUPDATE
                     MESSAGES INTO MESSTAB.

    L_SUBRC = SY-SUBRC.

    IF SMALLLOG <> 'X'.


      LOOP AT MESSTAB.

         MESSAGE ID messtab-msgid TYPE messtab-msgtyp NUMBER messtab-msgnr
                   INTO l_mstring
                  WITH messtab-msgv1 messtab-msgv2 messtab-msgv3 messtab-msgv4.

          WRITE: / MESSTAB-MSGTYP, L_MSTRING(250).


      ENDLOOP.
      SKIP.
    ENDIF.

** Erzeugen fehlermappe ************************************************

    IF L_SUBRC <> 0 AND E_GROUP <> SPACE.

      IF E_GROUP_OPENED = ' '.

        CALL FUNCTION 'BDC_OPEN_GROUP'

             EXPORTING  CLIENT   = SY-MANDT
                        GROUP    = E_GROUP
                        USER     = E_USER
                        KEEP     = E_KEEP
                       HOLDDATE = E_HDATE.


         E_GROUP_OPENED = 'X'.

      ENDIF.

      CALL FUNCTION 'BDC_INSERT'

           EXPORTING TCODE     = TCODE

           TABLES    DYNPROTAB = BDCDATA.

    ENDIF.
  REFRESH BDCDATA.
ENDFORM.

Che

Read only

Former Member
0 Likes
5,366

Hi Talha,

Could you put an image of the st22 exception?

Regards.

Read only

0 Likes
5,366

here you go

Read only

0 Likes
5,366

Show the portion of the dump that shows the code where it dumps.

Rob

Read only

0 Likes
5,366

Thats the line I get error because message id is empty and before this there is a line of code;

perform bdc_transaction using 'F-36'. followed by


    CALL TRANSACTION TCODE USING BDCDATA
                     MODE   CTUMODE
                     UPDATE CUPDATE
                     MESSAGES INTO MESSTAB.

After this, I get MESSTAB empty, It should include something like error or warning or success message.

Read only

0 Likes
5,366

Talha Ugur wrote:

Thats the line I get error because message id is empty and before this there is a line of code;

After this, I get MESSTAB empty, It should include something like error or warning or success message.

The problem is not caused by the message table being empty. The problem is that F-36 is dumping.

Rob

Read only

0 Likes
5,366

Dear Rob;

F-36 is not dumping! I know how to debug and Message tab is coming empty! Please dont respond if you dont know...

Read only

0 Likes
5,366
Read only

0 Likes
5,366

My BDC calls F-36 and F-36 creates the corresponding FI documents so I can say it completes its task successfully. But I dont get a SUCCESS message from it and thats why I'm getting a dump.

Read only

0 Likes
5,366

We were also facing similar issue where while posting the data in the call transaction of FB01, it was not populating messtab. The problem was we were creating a corresponding documents inside a BTE which was calling a asynchronous FM and which was disturbing the messgtab population.

So we exported the Newly created FI document using IMPORT/EXPORT and GET / SET parameter ID statements to catch the newly creatd document thru FB01.

if possible try doing the same in your case.

One more thing... inside your program try to read Parameter ID 'BLN' which stores the FI document number. it generally has the newly creatd FI document #.

Read only

0 Likes
5,366

If you are so sure that an empty msgtab means success then why not add one more condition while populating your success message? It will definitely get you through the dump.

IF ( SY-MSGID EQ 'F5' AND SY-MSGTYPE EQ 'S' AND SY-MSGNO EQ '312' )

OR ( SY-MSGID OR INITIAL OR SY-MSGTYPE IS INTIAL OR SY-MSGNO IS INITIAL )

Read only

0 Likes
5,366

Hi Talha Ugur,

    

The dump you are getting is because of message statement it is not recognizing the message type.

If the code where the dump your are getting is a custom code then try to change the message statement as below

   MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.   to

   MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

Read only

Former Member
0 Likes
5,367

Thanks for all of you guys for all your efforts but the problem cleared up in a very surprising way for me. We have checked the dates when this incident started and looked out for the requests on that time and it seems there has been a repair for F-55 and F-38 which was a "commit work". We have commented it and now all FI messages are working!

I dont know how is that happened because I put a break-point to that commit work line and in debug, system doesnt even get there

How a system gets effected when it doesnt actually go to that line on debug? Thats a mistery for me now...

Thanks for all of you again.

Talha

Read only

Former Member
0 Likes
5,366

PARAMETERS ctumode LIKE ctu_params-dismode DEFAULT 'N'.

PARAMETERS cupdate LIKE ctu_params-updmode DEFAULT 'L'.

PERFORM BDC_TRANSACTION USING 'F-36'.

FORM BDC_TRANSACTION USING TCODE.

REFRESH MESSTAB.
     CALL TRANSACTION TCODE USING BDCDATA
                      MODE   CTUMODE
                      UPDATE CUPDATE
                      MESSAGES INTO MESSTAB.


       LOOP AT MESSTAB.
         SELECT SINGLE * FROM T100 WHERE SPRSL = MESSTAB-MSGSPRA
                                   AND   ARBGB = MESSTAB-MSGID
                                   AND   MSGNR = MESSTAB-MSGNR.
         IF SY-SUBRC = 0.
           L_MSTRING = T100-TEXT.
           IF L_MSTRING CS '&1'.
             REPLACE '&1' WITH MESSTAB-MSGV1 INTO L_MSTRING.
             REPLACE '&2' WITH MESSTAB-MSGV2 INTO L_MSTRING.
             REPLACE '&3' WITH MESSTAB-MSGV3 INTO L_MSTRING.
             REPLACE '&4' WITH MESSTAB-MSGV4 INTO L_MSTRING.
           ELSE.
             REPLACE '&' WITH MESSTAB-MSGV1 INTO L_MSTRING.
             REPLACE '&' WITH MESSTAB-MSGV2 INTO L_MSTRING.
             REPLACE '&' WITH MESSTAB-MSGV3 INTO L_MSTRING.
             REPLACE '&' WITH MESSTAB-MSGV4 INTO L_MSTRING.
           ENDIF.
           CONDENSE L_MSTRING.
           WRITE: / MESSTAB-MSGTYP, L_MSTRING(250).
         ELSE.
           WRITE: / MESSTAB.
         ENDIF.
       ENDLOOP.
       SKIP.
ENDFORM.