Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Problem while checking code in debug mode

Former Member
0 Kudos

Hi,

I had developed a code in which is working gud as it is displaying the correct data but when i check it in the debug mode at the end of code where write statement is written it moves to some error which is not understandable to me.....

here's d code in which i am facing the problem:-

TABLES: VBAK,VBAP,MARA.

************BEGIN - DATA DECLARATION IN ITAB*****************

DATA: BEGIN OF ITAB OCCURS 0,

MATNR LIKE VBAP-MATNR, "Material Number

VBELN LIKE VBAK-VBELN, "Sales Document

ERDAT LIKE VBAK-ERDAT, "Date on Which Record Was Created

WERKS LIKE VBAP-WERKS, "Plant (Own or External)

POSNR LIKE VBAP-POSNR, "Sales Document Item

SPART LIKE MARA-SPART, "Division

MEINS LIKE MARA-MEINS, "Unit Of Measurment

MTART LIKE MARA-MTART, "Material Type

NTGEW LIKE MARA-NTGEW, "Net Weight

GEWEI LIKE MARA-GEWEI, "Weight Unit

PLNUM LIKE PLAF-PLNUM, "Planned order number

GSMNG LIKE PLAF-GSMNG, "Total planned order quantity

KDAUF LIKE PLAF-KDAUF, "Sales Order Number

KDPOS LIKE PLAF-KDPOS, "Item Number in Sales Order

AUFNR LIKE AFPO-AUFNR, "Order Number

PSMNG LIKE AFPO-PSMNG, "Order item quantity

ITEMDESC LIKE MAKT-MAKTX, "Item Description

TOTWT1 LIKE PLAF-GSMNG, "Calculation 1

TOTWT2 LIKE AFPO-PSMNG, "Calculation 2

WTKG LIKE MARA-NTGEW, "Net Weight

TOT LIKE PLAF-GSMNG, "

END OF ITAB.

DATA: BEGIN OF ITAB1 OCCURS 0,

MATNR LIKE VBAP-MATNR, "Material Number

VBELN LIKE VBAK-VBELN, "Sales Document

ERDAT LIKE VBAK-ERDAT, "Date on Which Record Was Created

WERKS LIKE VBAP-WERKS, "Plant (Own or External)

POSNR LIKE VBAP-POSNR, "Sales Document Item

SPART LIKE MARA-SPART, "Division

MEINS LIKE MARA-MEINS, "Unit Of Measurment

MTART LIKE MARA-MTART, "Material Type

NTGEW LIKE MARA-NTGEW, "Net Weight

GEWEI LIKE MARA-GEWEI, "Weight Unit

PLNUM LIKE PLAF-PLNUM, "Planned order number

GSMNG LIKE PLAF-GSMNG, "Total planned order quantity

KDAUF LIKE PLAF-KDAUF, "Sales Order Number

KDPOS LIKE PLAF-KDPOS, "Item Number in Sales Order

AUFNR LIKE AFPO-AUFNR, "Order Number

PSMNG LIKE AFPO-PSMNG, "Order item quantity

ITEMDESC LIKE MAKT-MAKTX, "Item Description

TOTWT1 LIKE PLAF-GSMNG, "Calculation 1

TOTWT2 LIKE AFPO-PSMNG, "Calculation 2

WTKG LIKE MARA-NTGEW, "Net Weight

TOT LIKE PLAF-GSMNG, "

END OF ITAB1.

**********END - DATA DECLARATION IN ITAB*****************

************BEGIN - ITAB FOR PL.ORDR********************

DATA: BEGIN OF ITPL OCCURS 0,

MATNR LIKE PLAF-MATNR, "Material Number

KDAUF LIKE PLAF-KDAUF, "Sales Order Number

KDPOS LIKE PLAF-KDPOS, "Item Number in Sales Order

PLNUM LIKE PLAF-PLNUM, "Planned order number

GSMNG LIKE PLAF-GSMNG, "Total planned order quantity

AUFNR LIKE PLAF-AUFNR, "Order Number

VQTY LIKE PLAF-GSMNG,

END OF ITPL.

************END - ITAB FOR PL.ORDR***********************

***********BEGIN - ITAB FOR PRD.ORDR********************

DATA: BEGIN OF ITPO OCCURS 0,

MATNR LIKE AFPO-MATNR, "Material Number

KDAUF LIKE AFPO-KDAUF, "Sales Order Number

KDPOS LIKE AFPO-KDPOS, "Item Number in Sales Order

PLNUM LIKE AFPO-PLNUM, "Planned order number

PSMNG LIKE AFPO-PSMNG, "Order item quantity

AUFNR LIKE AFPO-AUFNR, "Order Number

VQTY LIKE PLAF-GSMNG,

END OF ITPO.

DATA: TOT_QTY LIKE PLAF-GSMNG.

***********END - ITAB FOR PRD.ORDR********************

***********BEGIN - SELECTION SCREEN AND PARAMETERS AND VARIABLES**********

PARAMETERS : PLANT LIKE VBAP-WERKS OBLIGATORY.

SELECT-OPTIONS: SO_ORD FOR VBAK-VBELN,

DIV FOR MARA-SPART,

SO_DATE FOR VBAK-ERDAT,

P_MATNR FOR VBAP-MATNR.

***********END - SELECTION SCREEN AND PARAMETERS******

****BEGIN - DATA RETERIVAL FROM TABLES**********

SELECT BMATNR AVBELN AERDAT BWERKS BPOSNR CSPART CMEINS CMTART CNTGEW CGEWEI

FROM VBAK AS A

INNER JOIN VBAP AS B ON BVBELN = AVBELN

INNER JOIN MARA AS C ON CMATNR = BMATNR AND CSPART = BSPART

INTO TABLE ITAB WHERE CMTART = 'FERT' AND BWERKS = PLANT AND AVBELN IN SO_ORD AND CSPART IN DIV AND AERDAT IN SO_DATE AND BMATNR IN P_MATNR.

**********END - DATA RETERIVAL FROM TABLES**********

******BEGIN - TAKING DATA FROM TABLE ITPL AND ITPO TO ITAB********

LOOP AT ITAB.

REFRESH ITPL.

SELECT MATNR KDAUF KDPOS PLNUM GSMNG AUFNR FROM PLAF INTO TABLE ITPL WHERE

KDAUF = ITAB-VBELN AND

KDPOS = ITAB-POSNR AND

MATNR = ITAB-MATNR.

REFRESH ITPO.

SELECT MATNR KDAUF KDPOS PLNUM PSMNG AUFNR FROM AFPO INTO TABLE ITPO WHERE

KDAUF = ITAB-VBELN AND

KDPOS = ITAB-POSNR AND

MATNR = ITAB-MATNR.

LOOP AT ITPL.

ITAB-GSMNG = ITAB-GSMNG + ITPL-GSMNG.

ENDLOOP.

LOOP AT ITPO.

ITAB-PSMNG = ITAB-PSMNG + ITPO-PSMNG.

ENDLOOP.

MODIFY ITAB.

ENDLOOP.

SORT ITAB BY VBELN POSNR.

ITAB1[] = ITAB[].

SORT ITAB1 BY VBELN POSNR.

LOOP AT ITAB1.

TOT_QTY = ITAB1-GSMNG + ITAB1-PSMNG.

WRITE: / ITAB1-VBELN,ITAB1-MATNR,ITAB1-GSMNG,ITAB1-PSMNG,TOT_QTY,ITAB1-SPART.

ENDLOOP.

PLZZ tell me why the error is occurring?

Edited by: ricx .s on Jul 22, 2008 10:51 AM

8 REPLIES 8

Former Member
0 Kudos

What is the error you are getting?!

We aren't psychic!

Former Member
0 Kudos

Hi ricx,

You posted your code not the problem, Can you please tell us the error that you are getting.

Regards,

Sai

Former Member
0 Kudos

HI,

I am sorry for not highlighting the problem.

here it is in the write statement :-

LOOP AT ITAB1.

TOT_QTY = ITAB1-GSMNG + ITAB1-PSMNG.

WRITE: / ITAB1-VBELN,ITAB1-MATNR,ITAB1-GSMNG,ITAB1-PSMNG,TOT_QTY,ITAB1-SPART.*

ENDLOOP.

Edited by: ricx .s on Jul 22, 2008 10:56 AM

0 Kudos

Check Data type of TOT_QTY

Regards

rajesh

0 Kudos

Hi I have executed your report its working fine.

Regards

Rajesh

0 Kudos

You still haven't told us what error you are getting!

0 Kudos

HI,

I had told you my friend that i got error in the in the debug mode... more over i had changed the data type of TOT_QTY and then stored in ITAB1-TOT.

in the write statement:-

WRITE: / ITAB1-VBELN,ITAB1-ITEMID,ITAB1-GSMNG,ITAB1-PSMNG,TOT_QTY,ITAB1-TOT,ITAB1-SPART.

and the description of error in the debug mode is:-

1 FUNCTION CONVERSION_EXIT_ISOLA_OUTPUT.

2 *"----


3 ""Lokale Schnittstelle:

4 *" IMPORTING

5 *" VALUE(INPUT)

6 *" EXPORTING

7 *" VALUE(OUTPUT)

8 *"----


9 OUTPUT = SAVE_INPUT(1) = INPUT.

10 CHECK SAVE_INPUT(1) NA ' *'.

11 SELECT SINGLE * FROM T002 WHERE SPRAS = INPUT.

12 CHECK SY-SUBRC = 0.

13 OUTPUT = T002-LAISO.

14 ENDFUNCTION.

Edited by: ricx .s on Jul 22, 2008 11:14 AM

Former Member
0 Kudos

i am closing as solved the problem myself.