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 (Need your help)

Former Member
0 Likes
754

Hi,

I have created a BDC for Co11.

and i have generated a report which will fetch the order number, operation number and quantity.

in the first screen the data is getting passed

(the operation, order number is getting passed )

and goes to the next screen

but in the second screen i have set the value for one radio and check box as 'X' and the quantity i have passed in the program. but this is not getting reflected.

this happens only when i run the program.

separately when i run the recording this is not occuring..

Can any one help... please...

5 REPLIES 5
Read only

Former Member
0 Likes
642

Hello,

Please post the relevant code.

Have you passed CTU_PARAMS-DEFSIZ = 'X' in your CALL TRANSACTION. I assume that this is the problem.

Let me know how it goes about.

Regards, Murugesh AS

Read only

0 Likes
642

I have ran across this same problem. The trick is that the radiobuttons that are not selected must be set to ' '. Make sure that you are filling those fields with space. Should work for you.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
642

REPORT ZPPR_BDC_CO11CONF .

tables: caufv,afvc.

DATA: BEGIN OF it_caufv OCCURS 0,

aufnr LIKE caufv-aufnr,

lead_aufnr LIKE caufv-lead_aufnr,

gamng LIKE caufv-gamng,

l_bqty LIKE caufv-gamng,

l_cqty like caufv-gamng,

l_date type c length 10,

l_time type c length 8,

igmng like caufv-igmng,

l_pqty like caufv-igmng,

aufpl like caufv-aufpl,

vornr like afvc-vornr,

PLNBEZ like caufv-plnbez,

l_gmng like caufv-igmng,

END OF it_caufv.

data: it_afvc like it_caufv occurs 0 with header line.

DATA: l_gmng LIKE caufv-gamng.

DATA: BEGIN OF record1 OCCURS 0,

aufnr LIKE caufv-aufnr,

END OF record1.

include bdcrecx1.

parameters: dataset(132) lower case.

data: begin of record occurs 0,

  • data element: AUFNR

AUFNR_001(012),

  • data element: VORNR

VORNR_002(004),

  • data element: AUTENDRU

AUTER_003(001),

  • data element: AUSBU

AUSBU_004(001),

  • data element: RU_LMNGA

LMNGA_005(018),

  • data element: RU_VORME

MEINH_006(003),

  • data element: RU_ISMNG

ISM01_007(018),

  • data element: CO_ISMNGEH

ILE01_008(003),

  • data element: RU_ISMNG

ISM02_009(018),

  • data element: CO_ISMNGEH

ILE02_010(003),

end of record.

selection-screen begin of block blk with frame title text-001.

parameters: s_werks type caufv-werks OBLIGATORY.

select-options s_aufnr for caufv-aufnr OBLIGATORY.

parameters: s_qty type caufv-gamng OBLIGATORY.

selection-screen end of block blk.

start-of-selection.

perform get_data.

*perform open_dataset using dataset.

perform open_group.

loop at record.

*read dataset dataset into record.

if sy-subrc <> 0. exit. endif.

perform bdc_dynpro using 'SAPLCORU' '0100'.

perform bdc_field using 'BDC_CURSOR'

'CORUF-VORNR'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'CORUF-AUFNR'

record-AUFNR_001.

perform bdc_field using 'CORUF-VORNR'

record-VORNR_002.

perform bdc_dynpro using 'SAPLCORU' '0150'.

perform bdc_field using 'BDC_OKCODE'

'=BU'.

perform bdc_field using 'BDC_CURSOR'

'CORUF-AUTER'.

perform bdc_field using 'CORUF-AUTER'

record-AUTER_003.

perform bdc_field using 'CORUF-AUSBU'

record-AUSBU_004.

perform bdc_field using 'AFRUD-LMNGA'

record-LMNGA_005.

perform bdc_field using 'AFRUD-MEINH'

record-MEINH_006.

perform bdc_field using 'AFRUD-ISM01'

record-ISM01_007.

perform bdc_field using 'AFRUD-ILE01'

record-ILE01_008.

perform bdc_field using 'AFRUD-ISM02'

record-ISM02_009.

perform bdc_field using 'AFRUD-ILE02'

record-ILE02_010.

perform bdc_field using 'BDC_OKCODE'

'=BU'.

perform bdc_transaction using 'CO11'.

endloop.

perform close_group.

*perform close_dataset using dataset.

FORM get_data.

SELECT lead_aufnr INTO it_caufv-lead_aufnr FROM caufv WHERE werks EQ s_werks

"and aufnr = record1-aufnr.

AND aufnr IN s_aufnr.

SELECT aufnr gamng igmng PLNBEZ aufpl

FROM caufv INTO CORRESPONDING FIELDS OF TABLE it_caufv

WHERE lead_aufnr EQ it_caufv-lead_aufnr

AND werks EQ s_werks.

SELECT SINGLE gamng

FROM caufv INTO l_gmng

WHERE werks EQ s_werks

AND maufnr EQ space

AND lead_aufnr EQ it_caufv-lead_aufnr.

sort it_caufv by aufnr. "descending.

LOOP AT it_caufv.

it_caufv-l_bqty = it_caufv-gamng / l_gmng.

it_caufv-l_cqty = s_qty * it_caufv-l_bqty.

it_caufv-l_pqty = it_caufv-gamng - it_caufv-igmng.

select vornr

from afvc into it_afvc-vornr

where aufpl eq it_caufv-aufpl.

it_afvc-aufnr = it_caufv-aufnr.

it_afvc-gamng = it_caufv-gamng.

it_afvc-igmng = it_caufv-igmng.

it_afvc-plnbez = it_caufv-plnbez.

it_afvc-aufpl = it_caufv-aufpl.

it_afvc-l_bqty = it_caufv-l_bqty.

it_afvc-l_cqty = it_caufv-l_cqty.

it_afvc-l_pqty = it_caufv-l_pqty.

it_afvc-l_gmng = l_gmng.

append it_afvc.

endselect.

ENDLOOP.

ENDSELECT.

loop at it_afvc.

record-aufnr_001 = it_afvc-aufnr.

record-LMNGA_005 = it_afvc-l_cqty.

record-VORNR_002 = it_afvc-vornr.

record-LMNGA_005 = it_afvc-l_cqty.

record-AUTER_003 = 'X'.

record-AUSBU_004 = 'X'.

append record.

endloop.

ENDFORM. "get_data

Read only

Former Member
0 Likes
642

Hello,

I made a check in the system. It works fine in the system.

Here is the code sample:

report ZCO11_1

no standard page heading line-size 255.

parameters: P_auter,

p_ausbu,

p_lmnga(18).

*include bdcrecx1.

DATA: BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.

start-of-selection.

*perform open_group.

perform bdc_dynpro using 'SAPLCORU' '0100'.

perform bdc_field using 'BDC_CURSOR'

'CORUF-VORNR'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'CORUF-AUFNR'

'1002634'.

perform bdc_field using 'CORUF-VORNR'

'0020'.

perform bdc_dynpro using 'SAPLCORU' '0160'.

perform bdc_field using 'BDC_OKCODE'

'=BU'.

perform bdc_field using 'BDC_CURSOR'

'AFRUD-LMNGA'.

perform bdc_field using 'CORUF-TEILR'

''.

perform bdc_field using 'CORUF-ENDRU'

''.

perform bdc_field using 'CORUF-AUTER'

P_auter.

  • 'X'.

perform bdc_field using 'CORUF-AUSBU'

p_ausbu.

  • 'X'.

perform bdc_field using 'AFRUD-LMNGA'

p_lmnga.

  • '1'.

*perform bdc_transaction using 'CO11'.

call transaction 'CO11' using bdcdata mode 'A' update 'S'.

*perform close_group.

----


  • Start new screen *

----


FORM BDC_DYNPRO USING PROGRAM DYNPRO.

CLEAR BDCDATA.

BDCDATA-PROGRAM = PROGRAM.

BDCDATA-DYNPRO = DYNPRO.

BDCDATA-DYNBEGIN = 'X'.

APPEND BDCDATA.

ENDFORM.

----


  • Insert field *

----


FORM BDC_FIELD USING FNAM FVAL.

  • IF FVAL <> NODATA.

CLEAR BDCDATA.

BDCDATA-FNAM = FNAM.

BDCDATA-FVAL = FVAL.

APPEND BDCDATA.

  • ENDIF.

ENDFORM.

Hope this helps you.

Regards, Murugesh AS

Message was edited by: Murugesh Arcot

Read only

0 Likes
642

Yep, the following code is what is fixing the problem.



perform bdc_field using 'CORUF-TEILR'
''.
perform bdc_field using 'CORUF-ENDRU'
''.

This is where the clearing of the other radiobuttons

is happening.

Regards,

Rich Heilman