cancel
Showing results for 
Search instead for 
Did you mean: 

Pricing Updation Using LSMW

Former Member
0 Kudos

I would like to do Pricing updation using VK11 Tocde.for this can I use LSMW ..?

otherwise which one will be better for pricing updation data load?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

You can use BDC or LSMW or BAPI deopending on your convenience

it is the programmer choice

Final aim is right data has to be uploaded to SAP for the transactions to happen.

So depending on your easiness you use any one of the above

see the sample bdc for the VK11.

report ZSDBDCP_PRICING no standard page heading

line-size 255.

include zbdcrecx1.

*--Internal Table To hold condition records data from flat file.

Data: begin of it_pricing occurs 0,

key(4),

f1(4),

f2(4),

f3(2),

f4(18),

f5(16),

end of it_pricing.

*--Internal Table To hold condition records header .

data : begin of it_header occurs 0,

key(4),

f1(4),

f2(4),

f3(2),

end of it_header.

*--Internal Table To hold condition records details .

data : begin of it_details occurs 0,

key(4),

f4(18),

f5(16),

end of it_details.

data : v_sno(2),

v_rows type i,

v_fname(40).

start-of-selection.

refresh : it_pricing,it_header,it_details.

clear : it_pricing,it_header,it_details.

  • CALL FUNCTION 'UPLOAD'

  • EXPORTING

  • FILENAME = 'C:\WINDOWS\Desktop\pricing.txt'

  • FILETYPE = 'DAT'

  • TABLES

  • DATA_TAB = it_pricing

  • EXCEPTIONS

  • CONVERSION_ERROR = 1

  • INVALID_TABLE_WIDTH = 2

  • INVALID_TYPE = 3

  • NO_BATCH = 4

  • UNKNOWN_ERROR = 5

  • GUI_REFUSE_FILETRANSFER = 6

  • OTHERS = 7.

WRITE : / 'Condition Records ', P_FNAME, ' on ', SY-DATUM.

OPEN DATASET P_FNAME FOR INPUT IN TEXT MODE.

if sy-subrc ne 0.

write : / 'File could not be uploaded.. Check file name.'.

stop.

endif.

CLEAR : it_pricing[], it_pricing.

DO.

READ DATASET P_FNAME INTO V_STR.

IF SY-SUBRC NE 0.

EXIT.

ENDIF.

  • write v_str.

  • translate v_str using '#/'.

SPLIT V_STR AT ',' INTO it_pricing-key

it_pricing-F1 it_pricing-F2 it_pricing-F3

it_pricing-F4 it_pricing-F5 .

APPEND it_pricing.

CLEAR it_pricing.

ENDDO.

IF it_pricing[] IS INITIAL.

WRITE : / 'No data found to upload'.

STOP.

ENDIF.

loop at it_pricing.

At new key.

read table it_pricing index sy-tabix.

move-corresponding it_pricing to it_header.

append it_header.

clear it_header.

endat.

move-corresponding it_pricing to it_details.

append it_details.

clear it_details.

endloop.

perform open_group.

v_rows = sy-srows - 8.

loop at it_header.

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'

it_header-f1.

perform bdc_dynpro using 'SAPMV13A' '1004'.

perform bdc_field using 'BDC_CURSOR'

'KONP-KBETR(01)'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'KOMG-VKORG'

it_header-f2.

perform bdc_field using 'KOMG-VTWEG'

it_header-f3.

**Table Control

v_sno = 0.

loop at it_details where key eq it_header-key.

v_sno = v_sno + 1.

clear v_fname.

CONCATENATE 'KOMG-MATNR(' V_SNO ')' INTO V_FNAME.

perform bdc_field using v_fname

it_details-f4.

clear v_fname.

CONCATENATE 'KONP-KBETR(' V_SNO ')' INTO V_FNAME.

perform bdc_field using v_fname

it_details-f5.

if v_sno eq v_rows.

v_sno = 0.

perform bdc_dynpro using 'SAPMV13A' '1004'.

perform bdc_field using 'BDC_OKCODE'

'=P+'.

perform bdc_dynpro using 'SAPMV13A' '1004'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

endif.

endloop.

*--Save

perform bdc_dynpro using 'SAPMV13A' '1004'.

perform bdc_field using 'BDC_OKCODE'

'=SICH'.

perform bdc_transaction using 'VK11'.

endloop.

perform close_group.

<b>Reward points for useful Answers</b>

Regards

Anji

Former Member
0 Kudos

D u know in LSMW any standard program for LSMW?

Former Member
0 Kudos

Hi

There is no Std program for pricing in LSMW like for other mentioned below

0010 GL A/C Master Record

0020 Material master

0030 Material BOM

0035 LIFO Layer

0040 Vendor master

0050 Customer master

0060 Purchasing info rec.

0070 Condition record

0080 Purchase requisition

0085 Purchase Order

Reward points for useful Answers

Regards

Anji

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

LSMW is a third party tool used for data migration and we cannot go with some transactions in the LSMW and we cannot go with large data b'coz it won't support direct input method.and where as in BDC we can work with any type of data.and the usage of these types depends on the requirement of the client.

Thanks,

Raj.

Former Member
0 Kudos

Hi,

If you are going to update minimum no.of data then you can go for LSMW or CATT,if it is large amount of data then go for BDC.

Thanks,

Raj.

Former Member
0 Kudos

why dnt we use LSMW for huge number of data..?I think this is possible with LSMW also right?