3 weeks ago - last edited 3 weeks ago
Hi, experts.
Why does 'RV_MESSAGES_GET' initialize XNAST table.
Before calling xnast nad ynast tables are emty and at once it i start to execite this fm xnast is filling with data
Why it's happerning?
CALL FUNCTION 'RV_MESSAGES_GET'
EXPORTING
msg_kappl = 'ME'
TABLES
tab_xnast = xnast
tab_ynast = ynast
EXCEPTIONS
error_message = 4.
IF NOT sy-subrc IS INITIAL.
MESSAGE ID sy-msgid TYPE a NUMBER sy-msgno WITH
sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Request clarification before answering.
Basically, these tables are export parameters and not changing parameters. As any good programmer should do, they are initialised and populated in this GET data FM.
(The reason why TABLES parameters are considered obsolete)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Shizofrenik
That is how RV_MESSAGES_GET is implemented. It initializes both TAB_XNAST and TAB_YNAST at the very beginning:
FUNCTION RV_MESSAGES_GET.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*" IMPORTING
*" VALUE(MSG_KAPPL) LIKE NAST-KAPPL DEFAULT SPACE
*" VALUE(MSG_OBJKY_FROM) LIKE NAST-OBJKY DEFAULT ' '
*" VALUE(MSG_OBJKY_TO) LIKE NAST-OBJKY DEFAULT ' '
*" TABLES
*" TAB_XNAST STRUCTURE VNAST
*" TAB_YNAST STRUCTURE NAST
*"----------------------------------------------------------------------
REFRESH: tab_xnast,
tab_ynast.
Best regards
Dominik Tylczynski
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Shizofrenik
What you see is a case of Variable shadowing - XNAST defined in your program that calls RV_MESSAGE_GET is not the same as XNAST defined globally in the V61B function group. RV_MESSAGE_GET is defined in V61B, so all global variables of the function group are visible in all its functions. See SAP Help Validity and Visibility
Best regards
Dominik Tylczynski
User | Count |
---|---|
90 | |
15 | |
10 | |
8 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.