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: 

FM: PRICES_CHANGE error

Former Member
0 Kudos

Hello All,

I am using the FM <b>PRICES_CHANGE</b> and <b>PRICES_POST</b> to update material master prices. Table <b>T_MATPR</b> in FM is a deep structure. I am getting error when I am trying to pass the values to the CR sub table of table <b>T_MATPR</b> in FM <b>PRICES_CHANGE</b>. ( PP sub-table is working fine.)

when i do this for CR sub-table

<b> it_matpr-cr-waers = t001-waers.</b>, i am getting error..The data object "IT_MATPR" does not have a component called "CR-WAERS".

but, this works fine for PP sub-table like

<b>it_matpr-pp-kaln1 = wa_mbew-kaln1.</b>

Can anybody please help me?

Thank you in advance.

Chandni Reddy

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

You cannot directly give the value to the field WAERS for CR..As CR is an internal table..

First you have to prepare an internal table for CR and then move it to

T_MATPR-CR = ITAB[].

Then you READ TABLE T_MATPR-CR to read the values in the sub internal table..

Check this example..

type-pools: CKMPR.

DATA: T_MATPR TYPE CKMPR_MAT_PRICE.

DATA: T_MATPR_WA TYPE CKMPR_F_MAT_PRICE.

DATA: ITAB_CR TYPE CKMPR_CURTP_PRICES.

DATA: ITAB_CR_WA LIKE CKI_PAE_CR.

  • Prepare the main internal table.

T_MATPR_WA-PP-MATNR = 'ABC'.

  • Prepare the itab_cr internal table.

ITAB_CR_WA-CURTP = 'AB'.

ITAB_CR_WA-WAERS = 'USD'.

APPEND ITAB_CR_WA TO ITAB_CR.

ITAB_CR_WA-CURTP = 'AB'.

ITAB_CR_WA-WAERS = 'CAD'.

APPEND ITAB_CR_WA TO ITAB_CR.

T_MATPR_WA-CR[] = ITAB_CR[].

  • Main internal table.

APPEND T_MATPR_WA TO T_MATPR.

  • Processing the internal table.

loop at t_matpr into t_matpr_wa.

<b> read table t_matpr_wa-cr into itab_cr_wa

index 1.</b>

write: / t_matpr_wa-pp-matnr,

itab_cr_wa-waers.

endloop.

Thanks,

Naren

THanks,

Naren

3 REPLIES 3

Former Member
0 Kudos

I declared IT_MATPR like this:

DATA: it_matpr TYPE TABLE OF ckmpr_f_mat_price WITH HEADER LINE.

Thanks,

Chandni R

Former Member
0 Kudos

Hi,

You cannot directly give the value to the field WAERS for CR..As CR is an internal table..

First you have to prepare an internal table for CR and then move it to

T_MATPR-CR = ITAB[].

Then you READ TABLE T_MATPR-CR to read the values in the sub internal table..

Check this example..

type-pools: CKMPR.

DATA: T_MATPR TYPE CKMPR_MAT_PRICE.

DATA: T_MATPR_WA TYPE CKMPR_F_MAT_PRICE.

DATA: ITAB_CR TYPE CKMPR_CURTP_PRICES.

DATA: ITAB_CR_WA LIKE CKI_PAE_CR.

  • Prepare the main internal table.

T_MATPR_WA-PP-MATNR = 'ABC'.

  • Prepare the itab_cr internal table.

ITAB_CR_WA-CURTP = 'AB'.

ITAB_CR_WA-WAERS = 'USD'.

APPEND ITAB_CR_WA TO ITAB_CR.

ITAB_CR_WA-CURTP = 'AB'.

ITAB_CR_WA-WAERS = 'CAD'.

APPEND ITAB_CR_WA TO ITAB_CR.

T_MATPR_WA-CR[] = ITAB_CR[].

  • Main internal table.

APPEND T_MATPR_WA TO T_MATPR.

  • Processing the internal table.

loop at t_matpr into t_matpr_wa.

<b> read table t_matpr_wa-cr into itab_cr_wa

index 1.</b>

write: / t_matpr_wa-pp-matnr,

itab_cr_wa-waers.

endloop.

Thanks,

Naren

THanks,

Naren

0 Kudos

hi Naren,

can u help in this??

http://scn.sap.com/thread/3397708

Regards,

Ranjith