Quantcast
Channel: SCN: Message List - ABAP Development
Viewing all articles
Browse latest Browse all 10425

counter not considering 'Zero' qty value in text file

$
0
0

Hi All,

 

 

I have text file which i am uploading.

CUSTNO  CUSTPART  MATNR  PLNT  VRSN  date qty1 qt2  qt3  qt4 qt5 qt6...        qt8  qt9

2114168    8067    Y398996      50   W    02/04/2013    0       2      3      4    5       15    17    0
2844075    8067    Y398996       50   W    02/04/2013    21    0    23    24    34     36    0     38

 

we are doing a counter for this,

 

lets say i am getting 2 rows from text file into it1. now i am running the below code, it is not considering the '0' qt1 value, it is stating from qt2 with'2' qty and then 3...4...5...and like tht again it is not considering Qt16 as it is also 0 value.

what should i do so that it should consider 0 values also..asin my particular requiremnt.

based on each QTY, week number is assigned,.. so my case for 0 QTY1, week should be 201306, and for '2' QTY2 week numbr should be 201307 ans so on and forth...but

 

NOw with my coding it is considering for 0 QTY1, it is taking 201307.....instead of   201306

 

LOOP AT it1 INTO wa1.

      READ TABLE it2 INTO wa2 WITH KEY matnr = wa1-matnr

                                                     kunnr = wa1-kunnr

                                                     bedae = wa1-bedae

                                                     versb = wa1-versb.

      IF sy-subrc EQ 0.

        CALL METHOD r_zrpp12->get_counter

          EXPORTING

            wc_matnr  = wa1-matnr

            wc_versb  = wa1-versb

          IMPORTING

            wc_countr = wa1-countr.

        wa1-countr = wa1-countr + 1.

 

 

GET_COUNTER

CHECK wc_matnr IS NOT INITIAL.

  SELECT MAX( countr )

    FROM zsforcast

    INTO wc_countr

    WHERE matnr = wc_matnr

      AND versb = wc_versb.


Viewing all articles
Browse latest Browse all 10425

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>