Application Development 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: 

BDC Programming

Former Member
0 Kudos

I need help setting up a BDC that works through multiple screens before executing.

I want a BDC that will:

1) Open ME38 using a given Scheduling Agreement.

2) Select the given line item and view the "delivery schedule".

3) Select the given line item and go to Item > Components > New BOM Explosion

4) Then back out to screen '1117' and save.

For some reason this is not working. Am I missing something to allow this to execute?

PERFORM open_group.

perform bdc_dynpro using 'SAPMM06E' '0205'.

perform bdc_field using 'BDC_CURSOR'

'RM06E-EVRTN'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'RM06E-EVRTN'

wa_pkps-ebeln.

perform bdc_dynpro using 'SAPMM06E' '0222'.

perform bdc_field using 'BDC_CURSOR'

'RM06E-EVRTP(01)'.

perform bdc_field using 'BDC_OKCODE'

'=ET'.

perform bdc_field using 'RM06E-EBELP'

wa_pkps-ebelp.

perform bdc_field using 'RM06E-TCSELFLAG(01)'

'X'.

perform bdc_dynpro using 'SAPMM06E' '1117'.

perform bdc_field using 'BDC_CURSOR'

'RM06E-ETNR1'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'RM06E-ETNR1'

' 1'.

perform bdc_dynpro using 'SAPMM06E' '1117'.

perform bdc_field using 'BDC_CURSOR'

'RM06E-EEIND(01)'.

perform bdc_field using 'BDC_OKCODE'

'=LBST'.

  • Get the newest entry number on the sched. agrmt

SELECT * from EKET into wa_eket where

ebeln = wa_pkps-ebeln and

ebelp = wa_pkps-ebelp.

append wa_eket to it_eket.

ENDSELECT.

Sort it_eket by etenr DESCENDING.

loop at it_eket INTO wa_eket.

perform bdc_field using 'RM06E-ETNR1'

wa_eket-etenr.

EXIT.

ENDLOOP.

perform bdc_dynpro using 'SAPLM61Q' '0115'.

perform bdc_field using 'BDC_OKCODE'

'=BACK'.

perform bdc_field using 'BDC_CURSOR'

'MDBA-MATNR'.

perform bdc_dynpro using 'SAPMM06E' '1117'.

perform bdc_field using 'BDC_CURSOR'

'RM06E-ETNR1'.

perform bdc_field using 'BDC_OKCODE'

'=BU'.

perform bdc_field using 'RM06E-ETNR1'

wa_eket-etenr.

perform bdc_dynpro using 'SAPLSLVC_FULLSCREEN' '0500'.

perform bdc_field using 'BDC_OKCODE'

'=&F03'.

perform bdc_transaction using 'ME38'.

Sincerely,

Matt

1 REPLY 1

Former Member
0 Kudos

Answered - in case anyone else has this issue.

This was about scrolling down to the last line of the schedule agreement. So I needed to do a count on EKET to determine the number of line items and then scroll down that many line items (ycount).

PERFORM bdc_dynpro      USING 'SAPMM06E' '0205'.
            PERFORM bdc_field       USING 'BDC_CURSOR'
                                          'RM06E-EVRTN'.
            PERFORM bdc_field       USING 'BDC_OKCODE'
                                          '/00'.
            PERFORM bdc_field       USING 'RM06E-EVRTN'
                                          wa_pkps-ebeln.

            PERFORM bdc_dynpro      USING 'SAPMM06E' '0222'.
            PERFORM bdc_field       USING 'BDC_CURSOR'
                                          'RM06E-EVRTP(01)'.
            PERFORM bdc_field       USING 'BDC_OKCODE'
                                          '=ET'.
            PERFORM bdc_field       USING 'RM06E-EBELP'
                                          wa_pkps-ebelp.
            PERFORM bdc_field       USING 'RM06E-TCSELFLAG(01)'
                                          'X'.
            PERFORM bdc_dynpro      USING 'SAPMM06E' '1117'.
            PERFORM bdc_field       USING 'BDC_CURSOR'
                                          'RM06E-ETNR1'.
            PERFORM bdc_field       USING 'RM06E-ETNR1'
                                          y_count.
                                          "'1'.
            PERFORM bdc_field       USING 'BDC_OKCODE'
                                          '/00'.
            PERFORM bdc_dynpro      USING 'SAPMM06E' '1117'.
            PERFORM bdc_field       USING 'BDC_CURSOR'
                                          'RM06E-EEIND(1)'.
            PERFORM bdc_field       USING 'BDC_OKCODE'
                                         '=LBST'.
            PERFORM bdc_dynpro      USING 'SAPLM61Q' '0115'.
            PERFORM bdc_field       USING 'BDC_OKCODE'
                                          '=BACK'.
            PERFORM bdc_field       USING 'BDC_CURSOR'
                                          'MDBA-MATNR'.

            PERFORM bdc_dynpro      USING 'SAPMM06E' '1117'.
            PERFORM bdc_field       USING 'BDC_CURSOR'
                                          'RM06E-ETNR1'.
            PERFORM bdc_field       USING 'BDC_OKCODE'
                                          '=BU'.
            PERFORM bdc_field       USING 'RM06E-ETNR1'
                                          '1'.
            PERFORM bdc_dynpro      USING 'SAPLSLVC_FULLSCREEN' '500'.
            PERFORM bdc_field       USING 'BDC_OKCODE'
                                          '&F03'.

Matt