Application Development and Automation 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: 
Read only

What does this error mean?

Former Member
0 Likes
2,748

Hi all,

When i did a syntax check on a program and i got the following error (2 times):


A USING reference parameter should not be used. Instead define the parameter as a USING-VALUE(...) or CHANGING parameter.

When i double-clicked on the error to display the rows that was in question (rows 987 and 988), i couldn't identify what was actually wrong. Here's the statements of those rows:


FORM CONVERT_NEG_TO_BRACKET USING P_V_TEMP
                            CHANGING P_V_DAY.

  SEARCH P_V_TEMP FOR '-'.
  IF SY-SUBRC = 0.
    SHIFT P_V_TEMP RIGHT BY 1 PLACES.            "row 987
    SHIFT P_V_TEMP LEFT DELETING LEADING SPACE.  "row 988
    CONCATENATE '(' P_V_TEMP ')' INTO P_V_DAY.
  ELSE.
    SHIFT P_V_TEMP LEFT DELETING LEADING SPACE.
    MOVE P_V_TEMP TO P_V_DAY.
  ENDIF.

ENDFORM.

Perhaps anyone of you know what is actually wrong?

1 ACCEPTED SOLUTION
Read only

christian_wohlfahrt
Active Contributor
0 Likes
1,845

Hi Bernard!

This error has a simple reason: you change (in line 987, 988) using parameters - which shouldn't be changed by definition of using.

If you change parameters, changing would be right attribute.

It's just a simple matter of correct definitions.

Regards,

Christian

10 REPLIES 10
Read only

Former Member
0 Likes
1,845

Can you give the

perform code also.

i mean how you are calling the from.?

vijay

Message was edited by: Vijay Babu Dudla

Read only

0 Likes
1,845

PERFORM CONVERT_NEG_TO_BRACKET USING P_V_TEMP

P_V_DAY.

try to change perform to the above and try..

Read only

0 Likes
1,845

Hi Try to Give Changing for Both

PERFORM CONVERT_NEG_TO_BRACKET CHANGING P_V_TEMP

P_V_DAY

.

vijay

Read only

0 Likes
1,845

Vijay,

I did not declare P_V_TEMP and P_V_DAY in the earlier part of my program. Is it necessary that i do so? Why can't i use back V_PRTEMP and V_PRDAY?

Read only

0 Likes
1,845

not required to declare them.

i just gave example...

you use changing for both....

PERFORM CONVERT_NEG_TO_BRACKET USING V_PRTEMP

V_PRDAY.

Read only

0 Likes
1,845

Hi

i told it in my previous posts the saem check it.

vijay

Read only

abdul_hakim
Active Contributor
0 Likes
1,845

Hi

Can you provide ur PERFORM statement as well.

Try passing both parameters in CHANGING.

Regards,

Abdul

Read only

0 Likes
1,845

Here's the PERFORM statements that i used to do the calling, but its real long. Here goes:


*&---------------------------------------------------------------------*
*&    FORM PROCESS_DATA
*&---------------------------------------------------------------------*
FORM PROCESS_DATA.

* There are some long coding here, but i'm not going to post them,     *
* they are ridiculously long, but if you need me to * post the         *
* complete subroutine, let me know                                     *

*--> PR Days = PR release date - PR creation date
  IF T_PUR-UDATE_PR IS INITIAL OR T_PUR-BADAT IS INITIAL.
    V_PRDAY = '0'.
  ELSE.
    PERFORM CALC_ACT_WORKDAY
           USING T_PUR-BADAT T_PUR-UDATE_PR V_PRTEMP.
    PERFORM CONVERT_NEG_TO_BRACKET USING V_PRTEMP
                                   CHANGING V_PRDAY.
  ENDIF.

*--> RFQ Days = RFQ quotation date - PR release date
  IF T_PUR-UDATE_RFQ IS INITIAL OR T_PUR-UDATE_PR IS INITIAL.
   V_RFQDAY = '0'.
  ELSE.
PERFORM CALC_ACT_WORKDAY
        USING T_PUR-UDATE_PR T_PUR-UDATE_RFQ V_RFQTEMP.
PERFORM CONVERT_NEG_TO_BRACKET USING V_RFQTEMP
                                   CHANGING V_RFQDAY.
  ENDIF.

*--> PO days
*--> RFQ number not exist (PO Days = PO printed date - PR released date)
  IF T_PUR-ANFNR IS INITIAL.
      IF T_PUR-VSTAT = 1.
        IF T_PUR-DATVR_PO IS INITIAL OR T_PUR-UDATE_PR IS INITIAL.
          V_PODAY = '0'.
        ELSE.
PERFORM CALC_ACT_WORKDAY
        USING T_PUR-UDATE_PR T_PUR-DATVR_PO V_POTEMP.
          PERFORM CONVERT_NEG_TO_BRACKET USING V_POTEMP
                                         CHANGING V_PODAY.
        ENDIF.
      ELSEIF T_PUR-VSTAT = 2 OR T_PUR-VSTAT = 0.
        IF T_PUR-AEDAT IS INITIAL OR T_PUR-UDATE_PR IS INITIAL.
          V_PODAY = '0'.
        ELSE.
PERFORM CALC_ACT_WORKDAY
        USING T_PUR-UDATE_PR T_PUR-AEDAT V_POTEMP.
          PERFORM CONVERT_NEG_TO_BRACKET USING V_POTEMP
                                         CHANGING V_PODAY.
        ENDIF.
      ELSEIF T_PUR-VSTAT IS INITIAL.
        V_PODAY = '0'.
      ENDIF.
  ELSE.
*--> RFQ number exist (PO Days = PO printed date - Quotation date)
    IF T_PUR-VSTAT = 1.
      IF T_PUR-DATVR_PO IS INITIAL OR T_PUR-RFQ_AEDAT IS INITIAL.
        V_PODAY = '0'.
      ELSE.
PERFORM CALC_ACT_WORKDAY
        USING T_PUR-RFQ_AEDAT T_PUR-DATVR_PO V_POTEMP.
        PERFORM CONVERT_NEG_TO_BRACKET USING V_POTEMP
                                       CHANGING V_PODAY.
      ENDIF.
    ELSEIF T_PUR-VSTAT = 2 OR T_PUR-VSTAT = 0.
      IF T_PUR-AEDAT IS INITIAL OR T_PUR-RFQ_AEDAT IS INITIAL.
        V_PODAY = '0'.
      ELSE.
PERFORM CALC_ACT_WORKDAY
        USING T_PUR-RFQ_AEDAT T_PUR-AEDAT V_POTEMP.
        PERFORM CONVERT_NEG_TO_BRACKET USING V_POTEMP
                                       CHANGING V_PODAY.
      ENDIF.
    ELSEIF T_PUR-VSTAT IS INITIAL.
      V_PODAY = '0'.
    ENDIF.
  ENDIF.
  CLEAR: V_TABKEY,
         V_TABKEY2,
         V_TABKEY3.
ENDFORM.

*&---------------------------------------------------------------------*
*&      Form  GET_LATEST_GRNDATE
*&---------------------------------------------------------------------*
FORM GET_LATEST_GRNDATE.
DATA: D_LINES TYPE I.

  CLEAR T_DATE.
  DESCRIBE TABLE T_DATE LINES D_LINES.
  IF D_LINES GT 0.
    SORT T_DATE BY CPUDT EBELN EBELP DESCENDING.
    READ TABLE T_DATE WITH KEY EBELN = T_PUR-EBELN.
    IF SY-SUBRC = 0.
      READ TABLE T_DATE INDEX 1.
      MOVE: T_DATE-CPUDT TO T_PUR-CPUDT.
      MODIFY T_PUR TRANSPORTING CPUDT
             WHERE EBELN = T_PUR-EBELN AND EBELP = T_PUR-EBELP.
    ENDIF.
  ENDIF.

*--> GRN Days = GRN date - PO printed date
  IF T_PUR-VSTAT = 1.
    IF T_PUR-CPUDT IS INITIAL OR T_PUR-DATVR_PO IS INITIAL.
      V_GRNDAY = '0'.
    ELSE.
PERFORM CALC_ACT_WORKDAY
        USING T_PUR-DATVR_PO T_PUR-CPUDT V_GRNTEMP.
      PERFORM CONVERT_NEG_TO_BRACKET USING V_GRNTEMP
                                     CHANGING V_GRNDAY.
    ENDIF.
  ELSEIF T_PUR-VSTAT = 2 OR T_PUR-VSTAT = 0.
    IF T_PUR-CPUDT IS INITIAL OR T_PUR-AEDAT IS INITIAL.
      V_GRNDAY = '0'.
    ELSE.
PERFORM CALC_ACT_WORKDAY
        USING T_PUR-AEDAT T_PUR-CPUDT V_GRNTEMP.
      PERFORM CONVERT_NEG_TO_BRACKET USING V_GRNTEMP
                                     CHANGING V_GRNDAY.
    ENDIF.
  ENDIF.
ENDFORM.

*&---------------------------------------------------------------------*
*&      Form  GET_VAR_DAY
*&---------------------------------------------------------------------*
FORM GET_VAR_DAY.
DATA: V_TEMP2(8).

  V_TEMP2 = V_STADAY - V_ACTDAY.
  PERFORM CONVERT_NEG_TO_BRACKET USING V_TEMP2
                                 CHANGING V_VARDAY.

ENDFORM.

Read only

christian_wohlfahrt
Active Contributor
0 Likes
1,846

Hi Bernard!

This error has a simple reason: you change (in line 987, 988) using parameters - which shouldn't be changed by definition of using.

If you change parameters, changing would be right attribute.

It's just a simple matter of correct definitions.

Regards,

Christian

Read only

Former Member
0 Likes
1,845

hi

i think it would work if you pass P_V_temp and P_V_day by both value and reference.For this you must use changing for both

regards

Arun