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

BAPI - Change Payment Terms - FI Document

Former Member
0 Likes
3,077

Hi,

I need a BAPI to change the payment terms and the payment method supplement of FI documents. I'm trying the Function Module FI_ITEMS_CHANGE, even though I can change the payment block and some other fields with this one, I'm not able to change the 2 above fields mentionned.

Thanks for your collaboration!

Martin

5 REPLIES 5
Read only

Former Member
0 Likes
1,910

If you cannot change these fields using the document change screen (and I don't think you can), then it's not likely you will be able to change them using FMs or BAPIs.

You will probably have to reverse and re-post (and may be clear).

Rob

Read only

0 Likes
1,910

Hi Rob,

Thanks for your quick reply. Yes it is possible to modify those 2 fields with transaction FB02, however I want to be able to do it via the back end. Any ideas?

Thanks

Martin

Read only

0 Likes
1,910

I had used a BDC code (call transaction) to transaction FB09 to do this.

Read only

0 Likes
1,910

Hi, can you give me more details. I'm not an ABAP expert, but basically normally I call BAPI and Function Module via a webservice that I created. Is your BDC solution works in background, can you give me more details please?

Thanks

Martin

Read only

0 Likes
1,910

Hi,

I'm doing it with transaction FB02. But I would like to do it with a BAPI and I'm looking for it. Are you sure there is not?

Anyway, this is my BDC code, you can get it doing a recording of the transaction you want in the SM35.


data: lt_bdcdata   type table of bdcdata,
         lwa_bdcdata  type bdcdata,
         lv_pos(2)    type n,
         lv_buzei(15) type c,
         lv_line      type i.

  define bdc_dynpro.

    clear lwa_bdcdata.
    lwa_bdcdata-program  = &1.
    lwa_bdcdata-dynpro   = &2.
    lwa_bdcdata-dynbegin = 'X'.
    append lwa_bdcdata to lt_bdcdata.

  end-of-definition.
  define bdc_field.

    clear lwa_bdcdata.
    lwa_bdcdata-fnam = &1.
    lwa_bdcdata-fval = &2.
    append lwa_bdcdata to lt_bdcdata.

  end-of-definition.

  bdc_dynpro 'SAPMF05L' '0100'.
  bdc_field  'BDC_OKCODE' '/00'.
  bdc_field  'RF05L-BELNR' if_belnr.
  bdc_field  'RF05L-BUKRS' if_bukrs.
  bdc_field  'RF05L-GJAHR' if_gjahr.

  if if_buzei <= 31.
    lv_pos = if_buzei.
  else.
    lv_line = if_buzei.
    while lv_line > 31.
      bdc_dynpro 'SAPMF05L' '0700'.
      bdc_field  'BDC_OKCODE' '=P+'.
      lv_line = lv_line - 31.
    endwhile.
    lv_pos = lv_line.
  endif.
  concatenate 'RF05L-ANZDT(' lv_pos ')' into lv_buzei.
  bdc_dynpro 'SAPMF05L' '0700'.
  bdc_field  'BDC_OKCODE' '=PK'.
  bdc_field  'BDC_CURSOR' lv_buzei.

  bdc_dynpro 'SAPMF05L' '0301'.
  bdc_field  'BDC_OKCODE' '=ZK'.

  bdc_dynpro 'SAPMF05L' '1301'.
  bdc_field  'BDC_OKCODE' '=ENTR'.
  bdc_field  'BSEG-ZLSCH' if_zlsch.


  bdc_dynpro 'SAPMF05L' '0301'.
  bdc_field  'BDC_OKCODE' '=AE'.

  call transaction 'FB02'  using lt_bdcdata
                           mode  if_mode
                           messages into et_msg.

Hope this helps you.

If anyone knows a BAPI for this, please tell me.

regards,

Ainara