‎2018 Feb 23 6:28 AM
REPORT ztest.
DATA:lv_bukrs TYPE bukrs,
lv_werks TYPE werks,
lv_spart TYPE spart,
lv_vtweg TYPE vtweg.
PERFORM test1 USING lv_bukrs
lv_werks
CHANGING lv_spart
lv_vtweg.
PERFORM test2 USING lv_bukrs
lv_werks
CHANGING lv_spart
lv_vtweg.
*&---------------------------------------------------------------------*
*& Form test1
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->LV_BUKRS text
* -->LV_WERKS text
* -->LV_SPART text
* -->LV_WTEG text
*----------------------------------------------------------------------*
FORM test1 USING lv_bukrs
lv_werks
CHANGING lv_spart
lv_vtwteg.
ENDFORM. "test1
*&---------------------------------------------------------------------*
*& Form test2
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->LV_BUKRS text
* -->LV_WERKS text
* -->LV_SPART text
* -->LV_WTEG text
*----------------------------------------------------------------------*
FORM test2 USING lv_bukrs
CHANGING lv_werks
lv_spart
lv_vtwteg.
ENDFORM. "test2
For the 2nd subroutine FORM-ENDFORM, even though the USING and CHANGING parameters are not in synch,it is not throwing any error but showing syntactically correct and getting activated,where infact this should be an error.
Any thoughts on why is it so.
SAP ECC 6.0/SAP_ABA/701/0008/SAPKA70108.
Thanks,
K.Kiran.
‎2018 Feb 23 7:02 AM
It has always been like that. Only warnings in the syntax check if you change statically the values of USING parameters. SAP can't change the behavior because there's a lot of existing code which does that (even standard).
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapform.htm :
Anyway, subroutines are obsolete.
‎2018 Feb 23 7:34 AM
Don't use FORMs - they're obsolete language elements. For exactly reasons like the behaviour you're seeing!
‎2018 Feb 23 10:43 AM