Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Report

Hi experts,

I have a report it shows the total montly stock of YARN and CHEMICAL. The input fields are montly date and Matnerial number. Depending on the material number it shows the total stock of Yarn and chemical. i have taken two radio button one for yarn and another for CHEMICAL>

if i select yarn all the stock of yarn is shown.and if i select chemical all the chemcial stock is shown.

My requiment is i have to insert all the data which is coming in the internal table to Zstock1 database table for both yarn and chemical.

*THIS IS MY SELECTION SCREEN

PARAMETERS : r1 RADIOBUTTON GROUP g DEFAULT 'X', " YARN

opcase TYPE i DEFAULT 0 ,

opqty LIKE j_1iexcdtl-menge DEFAULT 0,

r2 RADIOBUTTON GROUP g, "CHEMICAL

opqty1 LIKE j_1iexcdtl-menge DEFAULT 0,

opqty2 LIKE j_1iexcdtl-menge DEFAULT 0,

opqty3 LIKE j_1iexcdtl-menge DEFAULT 0,

opqty4 LIKE j_1iexcdtl-menge DEFAULT 0,

opqty5 LIKE j_1iexcdtl-menge DEFAULT 0,

opqty6 LIKE j_1iexcdtl-menge DEFAULT 0,

opqty7 LIKE j_1iexcdtl-menge DEFAULT 0,

opqty8 LIKE j_1iexcdtl-menge DEFAULT 0,

opqty9 LIKE j_1iexcdtl-menge DEFAULT 0,

opqty10 LIKE j_1iexcdtl-menge DEFAULT 0,

opqty11 LIKE j_1iexcdtl-menge DEFAULT 0.

**THIS ARE THE PERFORM STATEMENTS USED TO GET THE DATA

IF r1 = 'X'.

PERFORM production.

PERFORM domestic.

PERFORM export.

PERFORM deemed_export.

*This is the internal table for YARN

LOOP AT it_totstk.

totcases = opcase + it_totstk-pcases.

clcase = totcases - it_totstk-dcases - it_totstk-ecases -

it_totstk-decases .

totqty = opqty + it_totstk-pmenge.

clqty = totqty - it_totstk-dmenge - it_totstk-emenge -

it_totstk-demenge .

FORMAT COLOR 6 INVERSE ON .

WRITE : /2(10) it_totstk-month ,sy-vline, 15(8)

opcase

NO-ZERO ,25(15) opqty NO-ZERO ,sy-vline,42(8) it_totstk-pcases NO-ZERO ,

52(15) it_totstk-pmenge

NO-ZERO,sy-vline,

70(8) totcases NO-ZERO,80(15) totqty NO-ZERO,sy-vline,97(8)

it_totstk-dcases NO-ZERO, 107(15) it_totstk-dmenge NO-ZERO,sy-vline,

125(8) it_totstk-ecases NO-ZERO ,135(15) it_totstk-emenge

NO-ZERO,sy-vline,

152(8) it_totstk-decases NO-ZERO,

162(15) it_totstk-demenge NO-ZERO,sy-vline,180(8) clcase

NO-ZERO,190(15)

clqty NO-ZERO ,sy-vline, 207(15) it_totstk-dexbas NO-ZERO,sy-vline,

225(15) it_totstk-dexbed NO-ZERO,sy-vline,243(15)

it_totstk-decs NO-ZERO,

sy-vline,260(15) it_totstk-dexaddtax1 NO-ZERO,sy-vline.

opcase = clcase.

opqty = clqty.

AT END OF month.

ULINE AT /(276).

ENDAT.

AT LAST.

SUM.

WRITE : /15 'Total:......',42(8) it_totstk-pcases,52(15)

it_totstk-pmenge,sy-vline,

98(8) it_totstk-dcases, 107(15) it_totstk-dmenge,

sy-vline,

125(8) it_totstk-ecases ,135(15) it_totstk-emenge,

sy-vline,152(8) it_totstk-decases,

162(15) it_totstk-demenge,sy-vline,207(15)

it_totstk-dexbas,sy-vline,

225(15) it_totstk-dexbed,sy-vline,243(15) it_totstk-decs

,sy-vline,260(15) it_totstk-dexaddtax1,sy-vline.

ULINE AT /(276).

ENDAT.

FORMAT COLOR OFF.

ENDLOOP.

IF R2 = 'X'.

the internal table for the CHEMICAL is

LOOP AT it_totstk1.

totqty = opqty + it_totstk1-pmenge.

clqty = totqty - it_totstk1-defkimg - it_totstk1-sfkimg .

WRITE : /2(10) it_totstk1-month NO-ZERO ,sy-vline,

15(15) opqty NO-ZERO,sy-vline,32(15) it_totstk1-pmenge

NO-ZERO,sy-vline,

50(15) totqty NO-ZERO,sy-vline,67(15) it_totstk1-sfkimg

NO-ZERO,sy-vline,

85(15) it_totstk1-defkimg NO-ZERO,sy-vline,

102(15) clqty NO-ZERO ,sy-vline,

120(15) it_totstk1-sexbas NO-ZERO,sy-vline,

137(15) it_totstk1-sexbed NO-ZERO,sy-vline,

155(15) it_totstk1-secs NO-ZERO,sy-vline,

172(15) it_totstk1-sexaddtax1 NO-ZERO,sy-vline,

190(15) it_totstk1-brtwr NO-ZERO,sy-vline,

210(15) it_totstk1-cpmenge NO-ZERO ,sy-vline,

227(15) it_totstk1-cpexbas NO-ZERO,sy-vline,

245(15) it_totstk1-cpimenge NO-ZERO,sy-vline,

262(15) it_totstk1-cpiexbas NO-ZERO,sy-vline.

opqty = clqty.

AT END OF month.

ULINE AT /(300).

ENDAT.

AT LAST.

SUM.

temptot = tempop + it_totstk1-pmenge.

tempcl = temptot - it_totstk1-sfkimg - it_totstk1-defkimg.

FORMAT COLOR 5.

WRITE : /2 'Total:..',15(15) tempop NO-ZERO,sy-vline,

32(15) it_totstk1-pmenge NO-ZERO,sy-vline,

50(15) temptot ,sy-vline NO-ZERO,

67(15) it_totstk1-sfkimg NO-ZERO,sy-vline,

85(15) it_totstk1-defkimg NO-ZERO,sy-vline,

102(15) tempcl NO-ZERO,sy-vline,

120(15) it_totstk1-sexbas NO-ZERO,sy-vline,

137(15) it_totstk1-sexbed NO-ZERO,sy-vline,

155(15) it_totstk1-secs NO-ZERO,sy-vline,

172(15) it_totstk1-sexaddtax1 NO-ZERO,sy-vline,

190(15) it_totstk1-brtwr NO-ZERO,sy-vline,

210(15) it_totstk1-cpmenge NO-ZERO,sy-vline,

227(15) it_totstk1-cpexbas NO-ZERO,sy-vline,

245(15) it_totstk1-cpimenge NO-ZERO,sy-vline,

262(15) it_totstk1-cpiexbas NO-ZERO,sy-vline.

FORMAT COLOR OFF.

ULINE AT /(300).

CLEAR : opqty,clqty,totqty,tempop,tempcl,temptot.

ENDAT.

ENDLOOP.

CLEAR : it_sales[],it_sales1[],it_totstk1[],

it_prod[],it_prod1[],it_corder[],it_corder1[].

CLEAR : it_sales,it_sales1,it_totstk1,

it_prod,it_prod1,it_corder,it_corder1.

now i have to insert this internal table values which are coming into ZSTOCK1 database table

the structure of zstock1 is shown below.

ZSTOCK1

Stock Table for Chemicals and Yarn

1.MANDT Client

2.WERKS Plant

3.LGORT Issue Storage Location

4.SPART Division

5.BWART Movement Type (Inventory Management)

5.MATNR Material Number

6.BUDAT Posting Date in the Document

7.OPCS Opening Cases

8.OPQT Operation Quantity

9.GEWEI Weight Unit

10.PRDCS Production Case

11.PRDQT Production Quantity

12.DOMCS Dom Cases

13.DOMQT Production Quantity

14.EXPCS Exp Cases

15.EXPQT Export Quantity

16.DEEMCS Deem Cases

17.DEEMQT Deemed Quantity

18.CAPCS Cap Cases

19.CAPQT Cap Qty

20.CAPINTCS Cap Initail CS

21.CAPINTQT Cap Initial Qty

22.CLCS Closing CS

23.CLQT Closed Quantity

24.EXCUR Currency

25.EXBAS Excise Duty Base Amount

26.BED Basic Excise Duty

27.CESS ECS Value

28.SECESS Additional Tax1 value

IF I select YARN the yarn data should be inserted in database and if i select chemcal the chemical details from the internal table should be inserted in database table

plaease help me its an urgent requiremnt to me.....

<b>useful answers are rewarded</b>

thanks & Regards,

K.Sunil kumar.

Tags:

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question