cancel
Showing results for 
Search instead for 
Did you mean: 

Making changes to date-related fields

Former Member
0 Kudos

Hi all,

Before i continue, i'd like to thank everyone who helped me develop my first ever ABAP program. However, i am now asked to make changes to it.

Criteria: The input field for PO Date (I_BEDAT) now has to become 2 separate input fields. The first field is where the user has to input the month that they wish to query (I_MONTH1 to I_MONTH2). The second field is where the user has to input the year that they wish to query (I_YEAR).

The following is what i have done so far, without any changes made yet. I'm still reading what the F1 help has to say before i do anything...but if anyone could give me a hint or an idea where to start with, please share it with me...thanks to all in advance


*&---------------------------------------------------------------------*
*& Report  ZLPUPO100                                                   *
*&                                                                     *
*& Description : Delivery Evaluation Report                            *
*&---------------------------------------------------------------------*
REPORT ZLPUPO100 NO STANDARD PAGE HEADING LINE-SIZE 135 LINE-COUNT 65.

TABLES: EKKO,
        EKPO,
        EKBE,
        EKET.

DATA: BEGIN OF ITAB OCCURS 0,
      EBELN LIKE EKKO-EBELN,  "Purchasing Document Number
      EBELP LIKE EKPO-EBELP,  "Item Number of Purchasing Document
      EINDT LIKE EKET-EINDT,  "Item delivery date
      BUDAT LIKE EKBE-BUDAT,  "Posting Date in the Document
      END OF ITAB.

DATA: BEGIN OF WTAB OCCURS 0,
      EBELN LIKE EKBE-EBELN,  "Purchasing Document Number
      EBELP LIKE EKBE-EBELP,  "Item Number of Purchasing Document
*      EINDT LIKE EKET-EINDT,  "Item delivery date
      BUDAT LIKE EKBE-BUDAT,  "Posting Date in the Document
      END OF WTAB.

DATA V_OVERDUE TYPE I.

DATA COUNT_OVERDUE TYPE I.
DATA COUNT_LINES TYPE I.

DATA V_PERCENTAGE TYPE P DECIMALS 9.

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

SELECT-OPTIONS:
  I_WERKS FOR EKPO-WERKS DEFAULT '6000' NO INTERVALS,  "PLANT
  I_BUKRS FOR EKKO-BUKRS DEFAULT 'GSPC' NO INTERVALS,  "COMPANY CODE
  I_EBELN FOR EKKO-EBELN DEFAULT,   "PO NUMBER
  I_LIFNR FOR EKKO-LIFNR,                              "VENDOR NUMBER
  I_MATNR FOR EKPO-MATNR.                              "MATERIAL NUMBER
  I_BEDAT FOR EKKO-BEDAT.                              "PO DATE
PARAMETERS I_MONTH(2) TYPE D.                         "YEAR
PARAMETERS I_YEAR(4) TYPE D DEFAULT SY-DATUM+0(4).    "MONTH
SELECTION-SCREEN END OF BLOCK 1.

SELECTION-SCREEN BEGIN OF BLOCK 2 WITH FRAME TITLE TEXT-002.
PARAMETERS:  P_ONET RADIOBUTTON GROUP RFMT DEFAULT 'X',  "ON-TIME
             P_ODUE RADIOBUTTON GROUP RFMT,  "OVERDUE
             P_ALLP RADIOBUTTON GROUP RFMT,  "BOTH (SORT BY PO NO.)
             P_ALLC RADIOBUTTON GROUP RFMT.  "BOTH (SORT BY CATEGORY)
SELECTION-SCREEN END OF BLOCK 2.

*&---------------------------------------------------------------------*
*&    START-OF-SELECTION
*&---------------------------------------------------------------------*
START-OF-SELECTION.

    PERFORM WRITE_HEADER.
    PERFORM SELECT_DATA.

END-OF-SELECTION.

*&---------------------------------------------------------------------*
*&    FORM WRITE_HEADER
*&---------------------------------------------------------------------*
FORM WRITE_HEADER.

WRITE: /1 'REPORT:', SY-REPID,
         118 'PAGE:', SY-PAGNO.
  WRITE: /1 'DATE:', SY-DATUM,
         54 'DELIVERY EVALUATION REPORT',
         118 'USER:', SY-UNAME, 147 ' ' .
  WRITE: / SY-ULINE(148).

ENDFORM.

*&---------------------------------------------------------------------*
*&    SELECT_DATA
*&---------------------------------------------------------------------*
FORM SELECT_DATA.

*--> IF ON-TIME DELIVERY IS SELECTED
IF P_ONET EQ 'X'.
  PERFORM WRITE_ONET.

*--> IF OVERDUE DELIVERY IS SELECTED
ELSEIF P_ODUE EQ 'X'.
  PERFORM WRITE_ODUE.

*--> IF BOTH IS SELECTED, SORT BY PO NUMBER
ELSEIF P_ALLP EQ 'X'.
  PERFORM WRITE_ALLP.

*--> IF BOTH IS SELECTED, SORT BY CATEGORY (+/-)
ELSE.
  PERFORM WRITE_ONET.
  PERFORM WRITE_ODUE.
ENDIF.

ENDFORM.

*&---------------------------------------------------------------------*
*&    FORM WRITE_ONET
*&---------------------------------------------------------------------*
FORM WRITE_ONET.

SELECT A~EBELN B~EBELP C~EINDT
        INTO CORRESPONDING FIELDS OF TABLE ITAB
        FROM ( EKKO AS A
               INNER JOIN EKPO AS B
                 ON B~EBELN = A~EBELN
               INNER JOIN EKET AS C
                 ON C~EBELN = B~EBELN AND
                    C~EBELP = B~EBELP AND
                    C~ETENR = '1')
        WHERE B~WERKS IN I_WERKS AND
              B~LOEKZ = ' ' AND
              A~BUKRS IN I_BUKRS AND
              A~BSTYP = 'F' AND
              A~EBELN IN I_EBELN AND
              A~LIFNR IN I_LIFNR AND
              B~MATNR IN I_MATNR AND
              A~BEDAT IN I_BEDAT
        ORDER BY A~EBELN B~EBELP.

*DELETE ADJACENT DUPLICATES FROM ITAB COMPARING ALL FIELDS.

SELECT EBELN EBELP BUDAT
  INTO CORRESPONDING FIELDS OF TABLE WTAB
  FROM EKBE
  WHERE WERKS IN I_WERKS AND
        EBELN IN I_EBELN AND
*        EBELP = ITAB-EBELP AND
        VGABE = '1' AND
        BEWTP = 'E'
  ORDER BY EBELN EBELP.

  FORMAT COLOR 1.
  WRITE: / SY-ULINE(86).
  WRITE: /1  '|', 20 'EVALUATION REPORT FOR ON-TIME DELIVERY ITEMS',
          86 '|'.
  FORMAT COLOR OFF.

  FORMAT COLOR 4.
  WRITE: / SY-ULINE(86).
  WRITE: /1  '|', 5 'PO No.',
          14 '|', 16 'PO Item No.',
          28 '|', 'PO Delivery Date',
          47 '|', 'Actual Delivery',
          65 '|', 'Overdue Days (+/-)',
          86 '|'.
  FORMAT COLOR OFF.
  WRITE: / SY-ULINE(86).
  NEW-LINE.

LOOP AT WTAB.
MOVE WTAB-BUDAT TO ITAB-BUDAT.
MODIFY ITAB TRANSPORTING BUDAT
  WHERE EBELN = WTAB-EBELN AND
        EBELP = WTAB-EBELP.
ENDLOOP.

LOOP AT ITAB.
  IF NOT ITAB-BUDAT IS INITIAL.
*--> IF BUDAT CONTAINS A DATE
    V_OVERDUE = ITAB-BUDAT - ITAB-EINDT.
  ELSE.
*-- IF BUDAT DOES NOT CONTAIN A DATE
    CLEAR V_OVERDUE.
  ENDIF.

*--> DISPLAY ON-TIME ITEMS ONLY
*  IF V_OVERDUE LE 0.
  IF ITAB-BUDAT IS INITIAL.
    DELETE ITAB.
  ELSEIF ITAB-BUDAT > ITAB-EINDT.
    DELETE ITAB.
  ELSE.

  WRITE: /1  '|', 3 ITAB-EBELN,   "PO NO
          14 '|', 19 ITAB-EBELP,  "PO ITEM NO
          28 '|', 33 ITAB-EINDT,  "PO DELIVERY DATE
          47 '|', 51 ITAB-BUDAT,  "ACTUAL DELIVERY DATE
          65 '|', V_OVERDUE,      "OVERDUE DAYS
          86 '|'.
*  WRITE: / SY-ULINE(86).
  ENDIF.
ENDLOOP.
  WRITE: / SY-ULINE(86).

ENDFORM.

*&---------------------------------------------------------------------*
*&    FORM WRITE_ODUE
*&---------------------------------------------------------------------*
FORM WRITE_ODUE.

SELECT A~EBELN B~EBELP C~EINDT
        INTO CORRESPONDING FIELDS OF TABLE ITAB
        FROM ( EKKO AS A
               INNER JOIN EKPO AS B
                 ON B~EBELN = A~EBELN
               INNER JOIN EKET AS C
                 ON C~EBELN = B~EBELN AND
                    C~EBELP = B~EBELP AND
                    C~ETENR = '1')
        WHERE B~WERKS IN I_WERKS AND
              B~LOEKZ = ' ' AND
              A~BUKRS IN I_BUKRS AND
              A~BSTYP = 'F' AND
              A~EBELN IN I_EBELN AND
              A~LIFNR IN I_LIFNR AND
              B~MATNR IN I_MATNR AND
              A~BEDAT IN I_BEDAT
        ORDER BY A~EBELN B~EBELP.

*DELETE ADJACENT DUPLICATES FROM ITAB COMPARING ALL FIELDS.

SELECT EBELN EBELP BUDAT
  INTO CORRESPONDING FIELDS OF TABLE WTAB
  FROM EKBE
  WHERE WERKS IN I_WERKS AND
        EBELN IN I_EBELN AND
*        EBELP = ITAB-EBELP AND
        VGABE = '1' AND
        BEWTP = 'E'
  ORDER BY EBELN EBELP.

  FORMAT COLOR 1.
  WRITE: / SY-ULINE(86).
  WRITE: /1  '|', 20 'EVALUATION REPORT FOR OVERDUE DELIVERY ITEMS',
          86 '|'.
  FORMAT COLOR OFF.

  FORMAT COLOR 4.
  WRITE: / SY-ULINE(86).
  WRITE: /1  '|', 5 'PO No.',
          14 '|', 16 'PO Item No.',
          28 '|', 'PO Delivery Date',
          47 '|', 'Actual Delivery',
          65 '|', 'Overdue Days (+/-)',
          86 '|'.
  FORMAT COLOR OFF.
  WRITE: / SY-ULINE(86).
  NEW-LINE.

LOOP AT WTAB.
MOVE WTAB-BUDAT TO ITAB-BUDAT.
MODIFY ITAB TRANSPORTING BUDAT
  WHERE EBELN = WTAB-EBELN AND
        EBELP = WTAB-EBELP.
ENDLOOP.

LOOP AT ITAB.
 ADD 1 TO COUNT_LINES.
ENDLOOP.

LOOP AT ITAB.
  IF NOT ITAB-BUDAT IS INITIAL.
*--> IF BUDAT CONTAINS A DATE
    V_OVERDUE = ITAB-BUDAT - ITAB-EINDT.
  ELSE.
*-- IF BUDAT DOES NOT CONTAIN A DATE
    CLEAR V_OVERDUE.
  ENDIF.

*--> DISPLAY OVERDUE ITEMS ONLY
  IF V_OVERDUE < 0.
*    ADD 1 TO COUNT_OVERDUE.
    DELETE ITAB.
  ELSEIF ITAB-BUDAT = ITAB-EINDT.
    DELETE ITAB.
  ELSE.
    ADD 1 TO COUNT_OVERDUE.
  WRITE: /1  '|', 3 ITAB-EBELN,   "PO NO
          14 '|', 19 ITAB-EBELP,  "PO ITEM NO
          28 '|', 33 ITAB-EINDT,  "PO DELIVERY DATE
          47 '|', 51 ITAB-BUDAT,  "ACTUAL DELIVERY DATE
          65 '|', V_OVERDUE,      "OVERDUE DAYS
          86 '|'.
*  WRITE: / SY-ULINE(86).
  ENDIF.

ENDLOOP.

  WRITE: / SY-ULINE(86).
  NEW-LINE.

  WRITE: /1  '|', 'Total Overdue Delivery Items: '.
  FORMAT COLOR 3.
  WRITE: COUNT_OVERDUE.
  FORMAT COLOR OFF.
  WRITE: 86 '|'.

COMPUTE V_PERCENTAGE = ( COUNT_OVERDUE * 100 ) / COUNT_LINES.

  WRITE: /1 '|', 'Percentage (%) Over All Deliveries: '.
    FORMAT COLOR 3.
    WRITE: V_PERCENTAGE DECIMALS 2.
  FORMAT COLOR OFF.
  WRITE: 86 '|'.

  WRITE: / SY-ULINE(86).

ENDFORM.

*&---------------------------------------------------------------------*
*&    FORM WRITE_ALLP
*&---------------------------------------------------------------------*
FORM WRITE_ALLP.

SELECT A~EBELN B~EBELP C~EINDT
        INTO CORRESPONDING FIELDS OF TABLE ITAB
        FROM ( EKKO AS A
               INNER JOIN EKPO AS B
                 ON B~EBELN = A~EBELN
               INNER JOIN EKET AS C
                 ON C~EBELN = B~EBELN AND
                    C~EBELP = B~EBELP AND
                    C~ETENR = '1')
        WHERE B~WERKS IN I_WERKS AND
              B~LOEKZ = ' ' AND
              A~BUKRS IN I_BUKRS AND
              A~BSTYP = 'F' AND
              A~EBELN IN I_EBELN AND
              A~LIFNR IN I_LIFNR AND
              B~MATNR IN I_MATNR AND
              A~BEDAT IN I_BEDAT
        ORDER BY A~EBELN B~EBELP.

*DELETE ADJACENT DUPLICATES FROM ITAB COMPARING ALL FIELDS.

SELECT EBELN EBELP BUDAT
  INTO CORRESPONDING FIELDS OF TABLE WTAB
  FROM EKBE
  WHERE WERKS IN I_WERKS AND
        EBELN IN I_EBELN AND
*        EBELP = ITAB-EBELP AND
        VGABE = '1' AND
        BEWTP = 'E'
  ORDER BY EBELN EBELP.

  FORMAT COLOR 1.
  WRITE: / SY-ULINE(86).
  WRITE: /1  '|', 20 'EVALUATION REPORT FOR ALL DELIVERY ITEMS',
          86 '|'.
  FORMAT COLOR OFF.

  FORMAT COLOR 4.
  WRITE: / SY-ULINE(86).
  WRITE: /1  '|', 5 'PO No.',
          14 '|', 16 'PO Item No.',
          28 '|', 'PO Delivery Date',
          47 '|', 'Actual Delivery',
          65 '|', 'Overdue Days (+/-)',
          86 '|'.
  FORMAT COLOR OFF.
  WRITE: / SY-ULINE(86).
  NEW-LINE.

LOOP AT WTAB.
MOVE WTAB-BUDAT TO ITAB-BUDAT.
MODIFY ITAB TRANSPORTING BUDAT
  WHERE EBELN = WTAB-EBELN AND
        EBELP = WTAB-EBELP.
ENDLOOP.

LOOP AT ITAB.
  IF NOT ITAB-BUDAT IS INITIAL.
*--> IF BUDAT CONTAINS A DATE
    V_OVERDUE = ITAB-BUDAT - ITAB-EINDT.
  ELSE.
*-- IF BUDAT DOES NOT CONTAIN A DATE
    CLEAR V_OVERDUE.
  ENDIF.

*--> DISPLAY BOTH ON-TIME AND OVERDUE ITEMS
  WRITE: /1  '|', 3 ITAB-EBELN,   "PO NO
          14 '|', 19 ITAB-EBELP,  "PO ITEM NO
          28 '|', 33 ITAB-EINDT,  "PO DELIVERY DATE
          47 '|', 51 ITAB-BUDAT,  "ACTUAL DELIVERY DATE
          65 '|', V_OVERDUE,      "OVERDUE DAYS
          86 '|'.
*  WRITE: / SY-ULINE(86).
ENDLOOP.
  WRITE: / SY-ULINE(86).

ENDFORM.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi all, thanks to everyone who gave me an idea where to start. As some of you were mentioning, it would have been simpler and straight to the point if i joined the I_MONTH and I_YEAR fields into 1 (I_BUDAT). So now i have managed to allow the user to input into the PO Date field using the MM.YYYY format.

My problem now: When assigning the input field for PO Date in the SELECTION-SCREEN using PARAMETERS earlier, it only allows the user to query for that particular month only. According to the requirements document that was given to me, i need to allow the user to query from month A to Month B (basically selecting and displaying PO Dates between months/years of their choice).

So how do i approach this?

Another matter, can i post questions about BADIs in this forum? or does it belong to a different forum?

former_member188419
Participant
0 Kudos

Hi Bernard,

If you want to use "from month A to month B", you need to use the Select-options. But you don't want multiple entries so this is where the NO-EXTENSION helps.

select-options : s_month for char2 no-extension.

parameters : p_year type year.

Here user can enter from and to values for the month. Then you can combine these two as follows...

data : v_date_from type d,

v_date_to type d,

v_last_day(2) type n.

concatenate '01'

s_month-low

p_year into v_date_from.

if not s_month-high is initial.

Get last day of month S_MONTH-HIGH for year p_year using LAST_DAY_OF_MONTHS into v_last_day

concatenate v_last_day

s_month-high

p_year into v_date_to.

else.

Get last day of month S_MONTH_LOW for year p_year using LAST_DAY_OF_MONTHS into v_last_day

concatenate v_last_day

s_month-low

p_year into v_date_to.

endif.

Now use these dates to query

select ....

from table

where bedat between v_date_from and v_date_to.

Hope this helps

Hari

Former Member
0 Kudos

Would you have to be able to check over year boundaries, I.E. 04/2004 to 02/2005?

Badi questions are welcome.

Rob

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Same thing applies to select-options....




report zrich_0001.
 
tables: ekko.
 
select-options: s_spbup for s601-spbup.
 
ranges: r_bedat for ekko-bedat.
 
start-of-selection.
 
 
  r_bedat-sign = 'I'.
  r_bedat-option = 'BT'.
  concatenate s_spbup-low '01' into
  r_bedat-low.
 
  concatenate s_spbup-high '01' into
  r_bedat-high.

  call function 'LAST_DAY_OF_MONTHS'
       exporting
            day_in            = r_bedat-high
       importing
            last_day_of_month = r_bedat-high.
  append r_bedat.
 
  write:/ s_spbup-low, s_spbup-high.
  write:/ r_bedat-low.
  write:/ r_bedat-high.


Regards,

Rich Heilman

Answers (6)

Answers (6)

Former Member
0 Kudos

Thanks Rich for what you have done and everyone else who was there since the beginning of my program. I've managed to deliver the program a day earlier...

Now i have to move on to my next assignment...BADIs...i'll have to read on it first...if i have any questions, i'll post it in another thread...

Yay, my second task for my first week on the job is to do BADIs, i wonder if i can do it...never done it before, in fact, i only just heard about it...

Thanks again to everyone! Cheers

former_member188419
Participant
0 Kudos

Hi Bernard,

DId you finsh the program? if so great. YEAR TYpe doesn't exist...I just gave some name. You can actually use the data element BKK_CYEAR for year type or YEAR in data types section of SE11 and you will get plenty of year data type fields.

Hari

Former Member
0 Kudos

Yes, i have finished by program. Thanks alot to everyone...

Former Member
0 Kudos

Hi Hari,

I'm trying out the sample codes you wrote but i obtained an error...something like "the type 'YEAR' is unknown", can you explain what it means?

Before that, i was writing something like:

I_BEDAT FOR S012-SPBUP OBLIGATORY.

in the selection-screen to enable the user to key in the 2nd field for PO Dates.

Bob,

What do you mean by checking my boudaries for the dates? is it to ensure that the user does not key in month values that are less than 1 and more than 12?

Former Member
0 Kudos

Sorry Bernard, I didn't see you question earlier.

No - I wasn't entirely sure what you were trying. I meant that if you were adding a certain number of months to a year month combination (say adding 2 months to 2004/11), you have to take the year into account. But rereading you post I don't think that's what you meant.

Rob

Former Member
0 Kudos

Hi,

Try with this it may help you out,

MOVE SY-DATUM+0(6) TO YEARMONTH .

And use this function module ,

POPUP_TO_SELECT_MONTH

Pass year month as import parameter to the funtion moudle.I hope this will work out in your case,

If it helps please reward the sutiable points.

Regards,

Irfan Hussain

Former Member
0 Kudos

Bernard - that's quite a program. I do think there is a problem with the selection from EKBE. Where you:

  select ebeln ebelp budat
    into corresponding fields of table wtab
    from ekbe
    where werks in i_werks and
          ebeln in i_ebeln and
*        EBELP = ITAB-EBELP AND
          vgabe = '1' and
          bewtp = 'E'
    order by ebeln ebelp.

you have to keep in mind that a PO item may have multiple GRs. It can be issued, reversed and re-issued. I think you should make sure the GR you pick up for an item is the last one and is not a reversal (EKBE-BWART = '101' is a GR, '102' is a GR reversal).

In addition, even though there is a GR, it may not be for the full amount. You should be able to check if the item is completely delivered by looking at EKPO-ELIKZ.

Rob

former_member188419
Participant
0 Kudos

By using parameters for both Month and user you are losing the range option. I guess you would like to have range option atleast for month. So for this no-extension might help..

select-options : s_month for char2 no-extension.

THis will enable user to enter only one row of data. You can read ths line and the value from Year parameter and build the date range.

Also Rather than using two options, one for Month and another for Year, It might be easy if you use one field for both. That way user can enter '012005' to '032006'. Also this avoids the other combination problems.

Let me know if you need more details

Hari

Former Member
0 Kudos

Hi Bernard,

congratulations to your first ever ABAP program.

Looks pretty good. I assume your question refers to

the declaration of your both new fields.

The data type 'D' already automatically declares a field

as a character field of length 8. You should declare

I_MONTH as type C length 2 and I_YEAR as length 4.

Better yet: Let I_MONTH refer to the datatype MONTH and

declare it as a listbox-parameter

(like: I_MONTH type MONTH AS LISTBOX). This has the advantage of having allowed values in your parameter listbox, coming from SAP standard. Unfortunetaly there is nothing like that for year and it would probably lead to far to describe how to create a set of allowed values for this parameter on your own.

The second problem you might have is how to execute a proper selection on this. One of maybe 10 different ways to do that would be to leave the I_BEDAT selewct-option as it is but to hide it from the selection screen and fill it automatically with what you have in your both new parameters. Select-Options are stored internally as a table that you append a line to, as follows:

  • Fill the LOW-value (FROM-value in selection) with

  • the first day of the month:

CONCATENATE I_YEAR I_MONTH '01' TO I_BEDAT-LOW.

  • Fill a new date variable with the last day of the

  • month by (as above, I_BEDAT-LOW replaced by your

  • variable, I_MONTH incremented before by 1, subtract

  • 1 from the readily concatenated date and you have the

  • last day of the month as result):

MOVE: NEW_DATE_VARIABLE TO I_BEDAT-HIGH,

'BT' TO I_BEDAT-OPTION, "(=Between)

'I' TO I_BEDAT-SIGN. "(=Inlusive)

APPEND I_BEDAT.

After that you can continue using the I_BEDAT-Selection

in your Selection as it is.

former_member181962
Active Contributor
0 Kudos

Hi Bernard,

Andreas was absolutely spot on with his solution.

I would suggest the sae thig.

The Function Module,

LAST_DAY_OF_MONTHS will help you to get the last day of the month (For the upper limit).

For hiding the select-optons, the syntax with NO-DISPLAY addition...

Regards,

Ravi Kanth

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Nice, If this is your first ABAP, then you are well on your way in being a great ABAPer. Nice Work. As the previous poster has suggested, you can have two fields or on field that would have the month and year. When you will to to convert it to the first day of the month as a date. THen I would suggest using the a function module to get the last day of the month.

Here is a sample program. In the selection screen enter a month/year like 11/2005.



report zrich_0001.

tables: ekko.

parameters: p_spbup type spbup.

ranges: r_bedat for ekko-bedat.

start-of-selection.


  r_bedat-sign = 'I'.
  r_bedat-option = 'EQ'.
  concatenate p_spbup '01' into
  r_bedat-low.

  call function 'LAST_DAY_OF_MONTHS'
       exporting
            day_in            = r_bedat-low
       importing
            last_day_of_month = r_bedat-high.
  append r_bedat.

  write:/ p_spbup.
  write:/ r_bedat-low.
  write:/ r_bedat-high.

Regards,

Rich Heilman