2007 Nov 29 12:49 AM
I am working on an interface and whn i chked my code using tran SLIN I got this message
"No read access to field L_TYPE1"
I have defined this in my program as:
data:
documentheader like bapiache09,
l_type1 like documentheader-OBJ_TYPE.
can you pleas tell me what the error is.
thanks
Rajeev
2007 Nov 29 1:15 AM
But you haven't used that L_TYPE1 variable.
To find out it, go to the program, click on the find button.. put L_TYPE1 and see how many results you are getting.
You can remove this variable if you don't want it.
Regards,
Naimesh Patel
Thanks for the reply rob.....u have commented those but will it work properly, I mean will my program give me the same output as it was giving me before.
Thanks
Rajeev
2007 Nov 29 1:15 AM
But you haven't used that L_TYPE1 variable.
To find out it, go to the program, click on the find button.. put L_TYPE1 and see how many results you are getting.
You can remove this variable if you don't want it.
Regards,
Naimesh Patel
2007 Nov 29 1:21 AM
Hey Naimesh,
I have used that variable:
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
EXPORTING
DOCUMENTHEADER = documentheader
IMPORTING
OBJ_TYPE = l_type1
OBJ_KEY = l_key1
OBJ_SYS = l_sys1
TABLES
ACCOUNTGL = glaccount
ACCOUNTPAYABLE = ap
CURRENCYAMOUNT = currencyamount
RETURN = return1.
read table return1 with key type = 'S'.
if syst-subrc eq 0.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
IMPORTING
RETURN = return2.
so can you please tell me where exactly the problem is.
Thanks
Rajeev
2007 Nov 29 3:16 AM
2007 Nov 29 3:23 AM
even I would have done that...but my team lead wants this message to get away !!!
Thanks
Rajeev
2007 Nov 29 3:33 AM
Try:
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
EXPORTING
documentheader = documentheader
IMPORTING
* obj_type = l_type1 "<====
* obj_key = l_key1 "<====
* obj_sys = l_sys1 "<====
TABLES
accountgl = glaccount
accountpayable = ap
currencyamount = currencyamount
return = return1.
READ TABLE return1 WITH KEY type = 'S'.
IF syst-subrc EQ 0.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
IMPORTING
return = return2.
I commented them all out, but if you are using the others, then leave them in.
Rob
2007 Nov 29 4:24 AM
Thanks for the reply rob.....u have commented those but will it work properly, I mean will my program give me the same output as it was giving me before.
Thanks
Rajeev
2007 Nov 29 2:26 PM
Yes - if you aren't going to use the variables, there's no need to return them.
Rob
2007 Nov 29 3:35 AM
Hi Rajeev,
Ideally you should ignore the message as its just a warning message & not an error message.
But if at all you want to remove that error from SLIN, then add a clear statement.
CLEAR : l_type, " Clear the field
l_key1,
l_sys1.
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
EXPORTING
DOCUMENTHEADER = documentheader
IMPORTING
OBJ_TYPE = l_type1
OBJ_KEY = l_key1
OBJ_SYS = l_sys1
TABLES
ACCOUNTGL = glaccount
ACCOUNTPAYABLE = ap
CURRENCYAMOUNT = currencyamount
RETURN = return1.
read table return1 with key type = 'S'.
if syst-subrc eq 0.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
IMPORTING
RETURN = return2.
Best regards,
Prashant
2007 Nov 29 4:43 AM
Hi Rajeev,
The message occured for the variable l_type1,.... is not used anywhere in the program. i.e.,l_type1 value is not displayed anywhere. If you really want to avoid this message then try to display the value, (WRITE l_type1).
Check the below code :
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
EXPORTING
DOCUMENTHEADER = documentheader
IMPORTING
OBJ_TYPE = l_type1
*OBJ_KEY = l_key1
*OBJ_SYS = l_sys1
TABLES
ACCOUNTGL = glaccount
ACCOUNTPAYABLE = ap
CURRENCYAMOUNT = currencyamount
RETURN = return1.
WRITE: l_type1.
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |