cancel
Showing results for 
Search instead for 
Did you mean: 

VK11 - BAPI_PRICES_CONDITIONS

abapdeveloper20
Contributor
0 Kudos

Hi Experts,

While using BAPI_PRICES_CONDITIONS for VK11 transaction to create pricing conditon records , the date range split is not happening ..

i.e it creates the entry but not splitting the date range.

For eg:

When I try to create a pricing condition with date range as 14.10.2008 to 31.12.2008 , it is working fine and creates new entry,

But when I try to create 20.10.2008 to 25.10.2008 , actually it has to create entries as

14.10.2008 to 19.10.2008

20.10.2008 to 25.10.2008

26.10.2008 to 31.12.2008

i.e date should splited up

But I creates only 20.10.2008 to 25.10.2008 and it deletes(or replaces) the old entry 14.10.2008 to 31.12.2008

Is there any other BAPI available to achieve this ???.

Any useful inputs is really helpful.

Thanks ~ Lakshmiraj

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi lakshmiraj,

Better way wud be to create a BDC with VK11 recording, where user will be uploading all conditions from an excel sheet.

also try FM VBDRV_CONDITION_RECORDS_SAVE

Regards,

Amit

abapdeveloper20
Contributor
0 Kudos

Hi Amit,

Thanks for your reply.

Actually the program having two options

1. Manual processing

2. Automatic upload.

In Manual , BDC of VK11 is used along with the same BAPI

In Automatic upload ,only the same BAPI is used.

Please let me know what is use of this BAPI or where its documentation available.

Thanks!!

Former Member
0 Kudos

Hi,

i've created many programs for updating condition records using BDC without using any BAPI.

tell me if u wud need a sample code with that regards.

Regards,

Amit

abapdeveloper20
Contributor
0 Kudos

Hi amit,

Thanks again!!! It will be really a great help if you share the sample code with me.

Is it possible for you to post here or drop in mail

Many Thanks!!!..

Former Member
0 Kudos

Hi,

the client in which i did this bdc is on 4.7..so bdc recording & screen wud be wrt 4.7 only..u wud need to do the recording again if any problems arise..my code wud be just to help u with the logic.

here it is:

*********************************************************

REPORT zbdc_vk11

NO STANDARD PAGE HEADING LINE-SIZE 255.

INCLUDE bdcrecx1.

PARAMETER:pr_file LIKE rlgrap-filename OBLIGATORY.

DATA: w_filenm LIKE rlgrap-filename.

DATA: rawdata(4096) TYPE c OCCURS 0.

DATA: BEGIN OF itab OCCURS 0,

kschl(4) TYPE c,

vkorg(4) TYPE c,

vtweg(2) TYPE c,

prodh1(1) TYPE c,

mfrgr(8) TYPE c,

zzprodh4(1) TYPE c,

werks(4) TYPE c,

kbetr(11) TYPE c,

konwa(5) TYPE c,

kpein(5) TYPE c,

kmein(3) TYPE c,

krech(1) TYPE c,

datab(10) TYPE c,

datbi(10) TYPE c,

END OF itab.

DATA : itab1 LIKE STANDARD TABLE OF itab WITH HEADER LINE.

DATA : channel(2) TYPE n VALUE 07.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR pr_file.

CALL FUNCTION 'WS_FILENAME_GET'

EXPORTING

def_filename = pr_file

mask = ',*.xls.'

mode = 'O'

title = 'Upload File'(i03)

IMPORTING

filename = pr_file

EXCEPTIONS

inv_winsys = 1

no_batch = 2

selection_cancel = 3

selection_error = 4

OTHERS = 5.

START-OF-SELECTION.

WRITE pr_file TO w_filenm.

CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'

EXPORTING

  • I_FIELD_SEPERATOR =

  • I_LINE_HEADER =

i_tab_raw_data = rawdata

i_filename = w_filenm

TABLES

i_tab_converted_data = itab

EXCEPTIONS

conversion_failed = 1

OTHERS = 2

.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

********************************************************************

LOOP AT itab.

MOVE-CORRESPONDING itab TO itab1.

APPEND itab1.

DO 10 TIMES.

IF channel = 13.

channel = 17.

ENDIF.

READ TABLE itab1 INDEX sy-tabix.

itab1-vkorg = 1100.

itab1-vtweg = channel.

APPEND itab1.

channel = channel + 1.

IF channel > 18.

EXIT.

ENDIF.

ENDDO.

channel = 07.

CLEAR itab1.

ENDLOOP.

********************************************************************

PERFORM open_group.

LOOP AT itab1.

PERFORM bdc_dynpro USING 'SAPMV13A' '0100'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RV13A-KSCHL'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'RV13A-KSCHL'

itab1-kschl.

PERFORM bdc_dynpro USING 'SAPLV14A' '0100'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RV130-SELKZ(02)'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=WEIT'.

PERFORM bdc_field USING 'RV130-SELKZ(01)'

''.

PERFORM bdc_field USING 'RV130-SELKZ(02)'

'X'.

PERFORM bdc_dynpro USING 'SAPMV13A' '1972'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RV13A-DATBI(01)'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'KOMG-VKORG'

itab1-vkorg.

PERFORM bdc_field USING 'KOMG-VTWEG'

itab1-vtweg.

PERFORM bdc_field USING 'KOMG-PRODH1'

itab1-prodh1.

PERFORM bdc_field USING 'KOMG-MFRGR'

itab1-mfrgr.

PERFORM bdc_field USING 'KOMG-ZZPRODH4'

itab1-zzprodh4.

PERFORM bdc_field USING 'KOMG-WERKS(01)'

itab1-werks.

PERFORM bdc_field USING 'KONP-KBETR(01)'

itab1-kbetr.

PERFORM bdc_field USING 'KONP-KONWA(01)'

itab1-konwa.

PERFORM bdc_field USING 'KONP-KPEIN(01)'

itab1-kpein.

PERFORM bdc_field USING 'KONP-KMEIN(01)'

itab1-kmein.

PERFORM bdc_field USING 'RV13A-KRECH(01)'

itab1-krech.

PERFORM bdc_field USING 'RV13A-DATAB(01)'

itab1-datab.

PERFORM bdc_field USING 'RV13A-DATBI(01)'

itab1-datbi.

PERFORM bdc_dynpro USING 'SAPMV13A' '1972'.

PERFORM bdc_field USING 'BDC_CURSOR'

'KOMG-WERKS(01)'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=SICH'.

PERFORM bdc_transaction USING 'VK11'.

CLEAR itab1.

ENDLOOP.

PERFORM close_group.

Regards,

Amit

Former Member
0 Kudos

The function module RV_CONDITION_COPY can meet your requirement.

Answers (3)

Answers (3)

asik_shameem
Active Contributor
0 Kudos

Hi

You can use FM RV_CONDITION_COPY, If you are not calling from remote server.

Former Member
0 Kudos

Hi Raj,

sorry.

regards

Prabhu

Edited by: Prabhu Peram on Oct 14, 2008 1:47 PM

Former Member
0 Kudos

Hi

I think BAPI_PRICES_CONDITIONS is not yet released for usage

Regards

Madhan

abapdeveloper20
Contributor
0 Kudos

Hi Madhan,

Thanks for your reply

BAPI is not yet released means ????

My understanding is ..date split is not possible by using this BAPI.

Correct me if i'm wrong.

Is there any other possible solution?

Rgds ~ Lakshmiraj

Former Member
0 Kudos

Hi

If you check the status of any function module, you can whether it is released for usage or not by SAP. I think it is available in the attribute section.

You can still use, but if you have any issues for the same and if you create OSS request, SAP may not support

Regards

Madhan