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

Problem in BDC????

Former Member
0 Likes
436

Hi All,

I have 2 questions regarding BDC:-

Ques1. When we do BDC through tcode "MM01" we have to go down through scrollbar if we want to Select Views from below as well. But scrollbar do not records. So what will be Solution??? How can we select views from down as well?

Ques2. I want to capture Errors in Call Transaction Method in BDC[Transaction("MM01")]. Can anybody give me documentation (and if possible coding also) that how it can be done. I know there is role of BDCMSGCOLL but don't know how it can be done.

Thanks and Regards,

Gagan

3 REPLIES 3
Read only

Former Member
0 Likes
414

Gagan,

Out of curiosity, why are you not using the BAPI for Material create?

Regards,

Ravi

Read only

Former Member
0 Likes
414

1.

Don't worry about the scrollbar recording, it will not record and without that your bdc code works perfect since when you click on view, that view will have some okcode which will be recorded and that okcode will be placed in the command bar. so just record it and write code accordingly it works perfect.

2.

see below code

CALL TRANSACTION 'FB02'

USING i_bdctab

MODE input_method

UPDATE c_update

MESSAGES INTO i_bdcmsg.

IF sy-subrc EQ 0.

LOOP AT i_bdcmsg

WHERE msgid EQ 'F5'

AND msgnr EQ '312'. "success message - mm

rc = 'X'.

ENDLOOP.

ENDIF.

in the code it was used for success message you can code for error message and populate it into another internal table .

Read only

Former Member
0 Likes
414

Hi gagan,

-->How can we select views from down as well?

1. In BDC, capturing fields like this (of table control)

can be done thru INDEX NUMBER (or row number)

If u observe the recording, and see the code

of screen 700, there is a field MSICHTAUSW-KZSEL

you can select the rows like this

MSICHTAUSW-KZSEL(1)

MSICHTAUSW-KZSEL(2)

MSICHTAUSW-KZSEL(6)

MSICHTAUSW-KZSEL(12)

etc.

Place their values as X.

2. want to capture Errors in Call Transaction Method in BDC[Transaction("MM01")].

While using Call Transaction

CALL TRANSACTION tcode USING bdcdata

MODE ctumode

UPDATE 'S'

MESSAGES INTO messtab.

Define this messtab as an internal table.

data : messtab type table of yhrs_bdcmsg with header line.

3. After the transaction is completed,

this message table will contain all

the messages (whether Error E, Success S, Warning W)

which have been issued during the simulation of transaction.

One must loop thru this messge table and

find out if there was an error (E) and appropriate handle the further action.

Hope the above helps.

Regards,

Amit M.