cancel
Showing results for 
Search instead for 
Did you mean: 

Code help...Enhanced Fields not picking any values

Former Member
0 Kudos

Hi all,

I have enhanced the datasource 0CO_PC_PCP_01. How ever the enhanced fields are not picking any values. Could some one take a look at my code and tell me if there are any errors in my code.

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

DATA: KKBW_PCP1 LIKE KKBW_PCP1.

CASE I_DATASOURCE.

WHEN '0CO_PC_PCP_01'.

LOOP AT c_t_data into KKBW_PCP1.

CLEAR W_INDEX.

W_INDEX = SY-TABIX.

KKBW_PCP1-ZZHRKFT = MBEW-HRKFT.

KKBW_PCP1-ZZKOSGR = MBEW-KOSGR.

SELECT SINGLE hrkft kosgr

INTO (KKBW_PCP1-ZZHRKFT, KKBW_PCP1-ZZKOSGR)

FROM MBEW

WHERE matnr = KKBW_PCP1-MATNR

AND BWKEY = KKBW_PCP1-WERKS.

MODIFY c_t_data FROM KKBW_PCP1 INDEX W_INDEX.

ENDLOOP.

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

Thanks in Advance..

Regards,

S.P

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

In RSA6, does the enhanced field is hidden? Check this out. If so, you will not the field. Uncheck the field, you will be fine.

Thanks

Ravi Thothadri

RThothadrii@yahoo.com

Former Member
0 Kudos

Ravi,

The fields are unhidden and also the field known in User Exit only is also unchecked. I am not sure why the fields are not picking values.

~S.P

Former Member
0 Kudos

Hi SP,

You could tackle this situation in the following two steps.

1. Make sure that values exist for the Material and Plant combination ( <b>KKBW_PCP1-MATNR</b> and <b>KKBW_PCP1-WERKS</b>) in the table MBEW. You can confirm this by putting a break-point in your code and testing the extractor in transaction <b>RSA3</b>.

2. Make sure that the enhanced fields(<b>ZZHRKFT</b> and <b>ZZKOSGR</b>) are not hidden (and Field only) in the datasource. This generally happens to the fields that are added by appending the ectract structure. You can confirm this by using transaction <b>RSA6</b> and selecting your datasouce.

You will have a clearer picture once you are through with these two steps.

Hope this was helpful.

Best regards,

Sanyam

Former Member
0 Kudos

Hi Sanyam,

I put a break point right after the code;

W_INDEX = SY-TABIX.

BREAK PAS5MTP.

I checked with MATNR and BWKEY. The material number and Plant value are getting populated. However, when I tried to check values for

KKBW_PCP1-ZZHRKFT and KKBW_PCP1-ZZKOSGR, it was not getting populated. Any suggestion on this issue would e very helpful.

Thanks,

S.P

Former Member
0 Kudos

can you do a sy-subrc check after this select

<i>SELECT SINGLE hrkft kosgr

INTO (KKBW_PCP1-ZZHRKFT, KKBW_PCP1-ZZKOSGR)

FROM MBEW

WHERE matnr = KKBW_PCP1-MATNR

AND BWKEY = KKBW_PCP1-WERKS</i>

Like this :

IF SY-SUBRC EQ 0.

MODIFY c_t_data FROM KKBW_PCP1 INDEX W_INDEX.

ENDIF.

Former Member
0 Kudos

Hi Manga,

I tried with the below code as specified by you but it did not work.

IF SY-SUBRC EQ 0.

MODIFY c_t_data FROM KKBW_PCP1 INDEX W_INDEX.

ENDIF.

~S.P

Former Member
0 Kudos

Where the fields you wanted to transfer were hidden at datasource level..

Did you try debugging.. in RSA3..

Former Member
0 Kudos

What is the strcuture of internal table c_t_data , is it comptabile with KKBW_PCP1 .. or can use<b> transporting</b> option of MODIFY statement.