cancel
Showing results for 
Search instead for 
Did you mean: 

BDC problem in F-30

Former Member
0 Kudos
329

Dear All,

I am writing BDC on F-30. On the last screen where I post the document there the line items are displayed in a table control & I have to select one of them based on payment term condition. By making changes in configuration payment term field is comming on screen.

<b>My question is that how to select the particular line item based on document number & payment term?</b>

Regards,

Dilip

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Andres,

Thank you for your prompt reply. But my requirement is that I have to select(activate) the table control entry which is having column value ZTERM(fro minternal table) matching with my internal table and document no.

In other words I have to find the combination of both in the displayed table conterol & then activate it for saving.

Regards,

Dilip

Former Member
0 Kudos

Hi,

This might seem to be absurd. But this is the way we some times do.

Just check from where the entries are populated into the Table control. Get those entries into one more internal table(second) and check with your(first) Internal table for the combination. Take that INDEX from the second Internal table and Select the appropriate table control entry.

Hope this works!

andreas_mann3
Active Contributor
0 Kudos

Hi,

try to preselect your items in your program and than use dynpro 733 with BELNR as i wrote in the quoted thread

regards Andreas

Former Member
0 Kudos

Hello,

The solution you suggested is correct but is it full proof that every time the index logic will work?

Regards,

Dilip

Former Member
0 Kudos

Hello Andres,

No beforeing going to the saving screen I am selecting NONE radiobutton which displays all the line items. There I have to select only that document which is in my internal table & zterm also matching with my internal table field.

My probleem is how to select appropriate line item no from the table control which is having more than 30 records.

Regards,

Dilip

andreas_mann3
Active Contributor
0 Kudos

Hi Diliip,

pls post the corresponding code

Andreas

Former Member
0 Kudos

Hello Andreas,

Following is recording.

On the screen where I post the document there I am uinable to select the appropriate document. In my recording I have scrolled to reach that. But how to get the record with mapping with ZTERM that I am displaying in the table control.

Regards,

Dilip

perform bdc_header using 'SAPDF05X' '3100'.

perform fnamval using 'BDC_OKCODE'

'/00'.

perform fnamval using 'BDC_CURSOR'

'DF05B-PSSKT(01)'.

perform fnamval using 'RF05A-ABPOS'

'1'.

perform bdc_header using 'SAPDF05X' '3100'.

perform fnamval using 'BDC_OKCODE'

'/00'.

perform fnamval using 'BDC_CURSOR'

'DF05B-PSSKT(01)'.

perform fnamval using 'RF05A-ABPOS'

'2'.

perform bdc_header using 'SAPDF05X' '3100'.

perform fnamval using 'BDC_OKCODE'

'/00'.

perform fnamval using 'BDC_CURSOR'

'DF05B-PSSKT(01)'.

perform fnamval using 'RF05A-ABPOS'

'3'.

perform bdc_header using 'SAPDF05X' '3100'.

perform fnamval using 'BDC_OKCODE'

'/00'.

perform fnamval using 'BDC_CURSOR'

'DF05B-PSSKT(01)'.

perform fnamval using 'RF05A-ABPOS'

'4'.

perform bdc_header using 'SAPDF05X' '3100'.

perform fnamval using 'BDC_OKCODE'

'/00'.

perform fnamval using 'BDC_CURSOR'

'DF05B-PSSKT(01)'.

perform fnamval using 'RF05A-ABPOS'

'5'.

perform bdc_header using 'SAPDF05X' '3100'.

perform fnamval using 'BDC_OKCODE'

'/00'.

perform fnamval using 'BDC_CURSOR'

'DF05B-PSSKT(01)'.

perform fnamval using 'RF05A-ABPOS'

'6'.

perform bdc_header using 'SAPDF05X' '3100'.

perform fnamval using 'BDC_OKCODE'

'/00'.

perform fnamval using 'BDC_CURSOR'

'DF05B-PSSKT(01)'.

perform fnamval using 'RF05A-ABPOS'

'7'.

perform bdc_header using 'SAPDF05X' '3100'.

perform fnamval using 'BDC_OKCODE'

'/00'.

perform fnamval using 'BDC_CURSOR'

'DF05B-PSSKT(01)'.

perform fnamval using 'RF05A-ABPOS'

'8'.

perform bdc_header using 'SAPDF05X' '3100'.

perform fnamval using 'BDC_OKCODE'

'/00'.

perform fnamval using 'BDC_CURSOR'

'DF05B-PSSKT(01)'.

perform fnamval using 'RF05A-ABPOS'

'9'.

perform bdc_header using 'SAPDF05X' '3100'.

perform fnamval using 'BDC_OKCODE'

'/00'.

perform fnamval using 'BDC_CURSOR'

'DF05B-PSSKT(01)'.

perform fnamval using 'RF05A-ABPOS'

'10'.

perform bdc_header using 'SAPDF05X' '3100'.

perform fnamval using 'BDC_OKCODE'

'=PI'.

perform fnamval using 'BDC_CURSOR'

'DF05B-PSBET(06)'.

perform fnamval using 'RF05A-ABPOS'

'11'.

perform bdc_header using 'SAPDF05X' '3100'.

perform fnamval using 'BDC_OKCODE'

'=BU'.

perform fnamval using 'BDC_CURSOR'

'DF05B-PSBET(06)'.

perform fnamval using 'RF05A-ABPOS'

andreas_mann3
Active Contributor
0 Kudos

hi,

try this code for transaction fb05:

DATA: BEGIN OF bkey OCCURS   0,
        belnr LIKE bseg-belnr,
        gjahr LIKE bseg-gjahr,
        buzei LIKE bseg-buzei,
      END OF bkey.
*Dynpro 122 - Header
    PERFORM bdc_dynpro USING 'SAPMF05A' '0122'.
    PERFORM bdc_field USING 'BKPF-BLDAT' agz-datum.
    PERFORM bdc_field USING 'BKPF-BLART' augblart.
    PERFORM bdc_field USING 'BKPF-BUKRS' htab-bukrs.
    PERFORM bdc_field USING 'BKPF-BUDAT' agz-datum.
    PERFORM bdc_field USING 'BKPF-WAERS' t001-waers.
    IF t003-xmref = 'X'.
      IF htab-xblnr <> space.
        PERFORM bdc_field USING 'BKPF-XBLNR' htab-xblnr.
      ELSE.
        PERFORM bdc_field USING 'BKPF-XBLNR' text-aag.
      ENDIF.
    ENDIF.
    UNPACK vorgang TO zeile.
    PERFORM bdc_field_loop USING zeile 'RF05A-XPOS1' 'X'.
    PERFORM bdc_field USING 'BDC_OKCODE'     'SL'.
*****************************************************************
    LOOP AT itab WHERE marked = 'X'.
*Dynpro 0710 -
      PERFORM bdc_dynpro USING 'SAPMF05A' '0710'.
      PERFORM bdc_field USING 'RF05A-AGKON' agku-kunnr.
      PERFORM bdc_field USING 'RF05A-AGBUK' agku-bukrs.
      PERFORM bdc_field USING 'BDC_OKCODE'     'SLB'.         "ins

*Dynpro 0733 - insert fi-document-nr.
      PERFORM bdc_dynpro USING 'SAPMF05A' '0733'.
      CLEAR:   zeile, cnt.
      LOOP AT htab WHERE agzif = agc-nr AND xfeld = 'X'
                    AND bukrs = agku-bukrs AND kunnr = agku-kunnr.

        CLEAR bkey.
        cnt = cnt + 1.
        UNPACK cnt TO zeile.
        PERFORM bdc_field_loop USING zeile 'RF05A-FELDN' 'BELNR'.
        MOVE-CORRESPONDING tab TO bkey.
        PERFORM bdc_field_loop USING zeile 'RF05A-SEL01'  bkey.
      ENDLOOP.
...

Andreas

Former Member
0 Kudos

Hello,

I am facing another problem my ibdcdata is getting empty where I am callint the transaction for upload. Kindly suggest where I am getting wrong. Rest my calling is same but when it comes out of that subroutine the value of the table becomes blank.

Regards,

Dilip

call transaction 'F-30' using ibdcdata

mode 'A'

update 'S'

messages into ibdcmsgcoll.

form bdc_header using progname dynpro.

ibdcdata-program = progname.

ibdcdata-dynpro = dynpro.

ibdcdata-dynbegin = 'X'.

append ibdcdata.

clear ibdcdata.

endform.

form fnamval using fnam fval.

ibdcdata-fnam = fnam.

ibdcdata-fval = fval.

append ibdcdata.

clear ibdcdata.

endform.

Former Member
0 Kudos

Hi All,

My last post was solved which mentions why my bdcdata table is getting clear.

How to make a combination of two fields shown in table control.

table control displays data like this.

Document Payment Terms

000001 PD99

000002 DF88

How to find the exact record with my internal table?

Regards,

Dilip

andreas_mann3
Active Contributor
0 Kudos

Hi ,

look this thread and use dynpro 733:

for payment term add:

PERFORM bdc_field_loop USING zeile 'RF05A-FELDN' 'ZTERM'.             
                                   
 PERFORM bdc_field_loop USING zeile 'RF05A-SEL02'  itab-zterm.  

Andreas