18 Mar 2009

Dynamic table name in select statement in ABAP

Here is a sample code piece used :

DATA name_snp_chn(20) TYPE c VALUE '/bic/azmmiv_sc00'.
DATA name_snp_usa(20) TYPE c VALUE '/bic/azmmiv_sU00'.
DATA name_snp_eur(20) TYPE c VALUE '/bic/azmmiv_sE00'.
DATA name_snp(20) TYPE c VALUE '/bic/azmmiv_os00'.

DATA name_mov_chn(20) TYPE c VALUE '/bic/azmmiv_2c00'.
DATA name_mov_usa(20) TYPE c VALUE '/bic/azmmiv_2U00'.
DATA name_mov_eur(20) TYPE c VALUE '/bic/azmmiv_2E00'.
DATA name_mov(20) TYPE c VALUE '/bic/azmmiv_o200'.

DATA : BEGIN OF ITAB OCCURS 0,
FACALID LIKE /BI0/MPLANT-FACTCAL_ID,
END OF ITAB.

if I_ZREGION = 'CHN'.
name_snp = name_snp_chn.
name_mov = name_mov_chn.
elseif I_ZREGION = 'USA'.
name_snp = name_snp_usa.
name_mov = name_mov_usa.
elseif I_ZREGION = 'EUR'.
name_snp = name_snp_eur.
name_mov = name_mov_eur.
endif.



IF i_test = 'X'.
BREAK-POINT.
* xl_plant = 'AA'.
* xl_stor_loc = '7000'.
* xl_material = '000000000000010712'.

xl_plant = 'RYAN'.
xl_stor_loc = '7000'.
xl_material = '000000000007519620'.

* xl_plant = 'CL00'.


SELECT * FROM (name_snp)
INTO CORRESPONDING FIELDS OF TABLE io_snapshot
WHERE plant EQ xl_plant
AND stor_loc EQ xl_stor_loc
AND material EQ xl_material.
ENDIF.

17 Mar 2009

Where to check for code used in extractor of DS

Goto to RSA2 in source system.
Give the datasource.
Check the extractor details. Click on the extractor. It will open the code.

3 Mar 2009

Idocs between R3 and BW while extraction

1)When BW executes an infopackage for data extraction the BW system sends a Request IDoc ( RSRQST ) to the ALE inbox of the source system.Information bundled in Request IDoc (RSRQST) is :
Request Id ( REQUEST )
Request Date ( REQDATE )
Request Time (REQTIME)
Info-source (ISOURCE)
Update mode (UPDMODE )
2)The source system acknowledges the receipt of this IDoc by sending an Info IDoc (RSINFO) back to BW system.The status is 0 if it is ok or 5 for a failure.
3)Once the source system receives the request IDoc successfully, it processes it according to the information in the request. This request starts the extraction process in the source system (typically a batch job with a naming convention that begins with BI_REQ).
The request IDoc status now becomes 53 (application document posted). This status means the system cannot process the IDoc further
4)The source system confirms the start of the extraction job by the source system to BW by sending another info IDoc (RSINFO) with status = 1
5)Transactional Remote Function Calls (tRFCs) extract and transfer the data to BW in data packages. Another info IDoc (RSINFO) with status = 2 sends information to BW about the data package number and number of records transferred
6)At the conclusion of the data extraction process (i.e., when all the data records are extracted and transferred to BW), an info IDoc (RSINFO) with status = 9 is sent to BW, which confirms the extraction process.