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

Error message

Former Member
0 Likes
1,051

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

1 ACCEPTED SOLUTION
Read only

naimesh_patel
Active Contributor
0 Likes
1,025

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

9 REPLIES 9
Read only

naimesh_patel
Active Contributor
0 Likes
1,026

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

Read only

0 Likes
1,025

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

Read only

0 Likes
1,025

I would just ignore it.

Rob

Read only

0 Likes
1,025

even I would have done that...but my team lead wants this message to get away !!!

Thanks

Rajeev

Read only

0 Likes
1,025

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

Read only

0 Likes
1,025

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

Read only

0 Likes
1,025

Yes - if you aren't going to use the variables, there's no need to return them.

Rob

Read only

Former Member
0 Likes
1,025

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

Read only

Former Member
0 Likes
1,025

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.