Skip to Content
0
Former Member
Oct 30, 2007 at 02:15 PM

Allocation Verification Report - CA03

25 Views

Hello Friends,

I am developing a Component Allocation Verification Report similar to CA03.

I am a bit unfamilar with the tables and the flow.

Here is my selection screen.

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

*SELECTION-SCREEN

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

SELECTION-SCREEN : BEGIN OF BLOCK 1 WITH FRAME TITLE TEXT-001.

SELECT-OPTIONS : P_WERKS FOR MARC-WERKS NO INTERVALS OBLIGATORY,

S_DISPO FOR MARC-DISPO OBLIGATORY,

S_MATNR FOR MARC-MATNR,

P_ADATU FOR MKAL-ADATU NO INTERVALS OBLIGATORY

DEFAULT SY-DATUM,

P_BDATU FOR MKAL-BDATU NO INTERVALS OBLIGATORY

DEFAULT '99991231'.

PARAMETER: P_CAPID LIKE TC04-CAPID OBLIGATORY

DEFAULT 'PP01'."Application identifier

SELECTION-SCREEN : END OF BLOCK 1.

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

This is the output the user wants.

Plant Material RoutingComponent ComponentDescription Operation Allocation

It has to be a similar output to as of CA03 transaction.

Any Suggestions.

I have done the development to some extent but I am missing some things.

Below is the code that I have done so far.

Please help.

&----


*& Form EXTRACT_EXTRACT_DATA

&----


  • text

----


FORM EXTRACT_EXTRACT_DATA .

SELECT MARC~MATNR

MARC~WERKS

MARC~DISPO

MKAL~ADATU

MKAL~BDATU

INTO TABLE T_MARC_MKAL

FROM MARC

INNER JOIN MKAL

ON MARCMATNR = MKALMATNR

WHERE MARC~MATNR IN S_MATNR

AND MARC~WERKS IN P_WERKS.

LOOP AT T_MARC_MKAL INTO W_MARC_MKAL.

CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'

EXPORTING

CAPID = P_CAPID

DATUV = V_DATUV

MTNRV = W_MARC_MKAL-MATNR

STLAL = '01'

STLAN = '1'

WERKS = P_WERKS-LOW

IMPORTING

TOPMAT = XTOPMAT

DSTST = XFELD

TABLES

STB = XSTPOX

MATCAT = XMATCAT

EXCEPTIONS

ALT_NOT_FOUND = 1

CALL_INVALID = 2

MATERIAL_NOT_FOUND = 3

MISSING_AUTHORIZATION = 4

NO_BOM_FOUND = 5

NO_PLANT_DATA = 6

NO_SUITABLE_BOM_FOUND = 7

OTHERS = 8.

LOOP AT XSTPOX WHERE SANFE = 'X'.

W_BOM-MATNR_BOM = XSTPOX-IDNRK.

APPEND W_BOM TO T_BOM.

ENDLOOP.

ENDLOOP.

SORT T_BOM BY MATNR_BOM.

DELETE ADJACENT DUPLICATES FROM T_BOM.

IF NOT T_MARC_MKAL[] IS INITIAL.

SELECT *

INTO TABLE T_MAPL

FROM MAPL

FOR ALL ENTRIES IN T_MARC_MKAL

WHERE MATNR = T_MARC_MKAL-MATNR

AND WERKS IN P_WERKS.

IF NOT T_MAPL[] IS INITIAL.

SELECT PLNTY PLNNR PLNKN ZAEHL

DATUV AENNR LOEKZ PARKZ SUMNR

VORNR STEUS ARBID OBJTY WERKS

INTO TABLE T_PLPO

FROM PLPO

FOR ALL ENTRIES IN T_MAPL

WHERE PLNTY = T_MAPL-PLNTY

AND PLNNR = T_MAPL-PLNNR

  • AND PLNKN = T_MAPL-PLNKN

AND ZAEHL = T_MAPL-ZAEHL.

ENDIF.

ENDIF.

ENDFORM. " EXTRACT_EXTRACT_DATA

Thanks,

Ster

Ster.

 
 
 
 

<b></b>