Skip to Content
0
Nov 03, 2012 at 01:07 PM

Problem In User Exit PCSD0005 at time BOM Creation

521 Views

Hi SAP Expert,,

I have change user exit PCSD0005 (EXIT_SAPLCSDI_006) to restrict same component not allow at time of BOM creation ( T-Code CS01).

When user create BOM Through Transaction the no issue in this User exit.

But when User Run BDC to BOM Creation then it gives message error which is written in my user exit " Same Component Not Allowed "

Note: First BOM created Successfully but problem in next BOM creation which content same component ( Please see give below Excel Data )

Coding***

IF SY-TCODE EQ 'CS01' OR SY-TCODE EQ 'CS02'.

DATA : BEGIN OF TAB,

IDNRK TYPE STPOB-IDNRK,

END OF TAB.

DATA : T_TAB LIKE STANDARD TABLE OF TAB WITH HEADER LINE.

DATA : WA LIKE LINE OF T_TAB.

IMPORT T_TAB FROM MEMORY ID 'ZPP'.

MOVE: COMPONENT TO WA-IDNRK.

IF T_TAB[] IS NOT INITIAL.

LOOP AT T_TAB WHERE IDNRK EQ WA-IDNRK.

MESSAGE 'SAME COMPONENT NOT ALLOWED ' TYPE 'E'.

ENDLOOP.

  1. ENDIF.

APPEND WA TO T_TAB. " SORTED BY IDNRK.

EXPORT T_TAB TO MEMORY ID 'ZPP'.

  1. ENDIF.

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

** The T_TAB is not clear at the time of SAVE Button of first BOM which is present in my Excel file.

Excle Formate File Data for BDC :

Material Code

Plant

Bom Usage

Base Quantity

Raw Material

Raw material Qty

11000005041

1g10

1

1

10000019496

  1. 1976.469

11000005041

1g10

1

1

10000013297

  1. 120.629

11000005041

1g10

1

1

10000013298

  1. 714.018

11000005041

1g10

1

1

10000013299

  1. 43.578

11000005041

1g10

1

1

10000013304

  1. 995.29575

11000005041

1g10

1

1

10000013308

  1. 60.74575

11000005042

1g10

1

1

10000019496

1,397.70

11000005042

1g10

1

1

10000013297

79

11000005042

1g10

1

1

10000013298

  1. 46.7

11000005042

1g10

1

1

10000013299

  1. 470.6

11000005042

1g10

1

1

10000013304

  1. 158.2

11000005042

1g10

1

1

10000013308

  1. 635.9

11000005042

1g10

1

1

10000013322

  1. 9.2

Is it possible with this user exit or there is another way.

please guide me..