Sometimes names of data elements look rather cryptic. So i prefer inline declarations like
DATA(lv_sap_object) = CONV toav0-sap_object( 'PRINTDOC' ).
instead of
DATA(lv_sap_object) = CONV saeanwdid( 'PRINTDOC' ).
It works. But I never seen de...
If you mean an internal table:TYPES tt_mara TYPE TABLE OF mara WITH EMPTY KEY.
DATA(lt_mara) = VALUE tt_mara( ( matnr = '1580') ( matnr = '1581') ( matnr = '1582') ).
TYPES tt_matnr TYPE TABLE OF matnr WITH EMPTY KEY.
DATA(lt_matnr) = VALUE tt_matnr...
Some code can be executed in a dialog process instead of batch process, if it is scheduled as a job. SY-BATCH is set in a batch process only. In particular CALL FUNCTION func STARTING NEW TASK task DESTINATION IN GROUPuses dialog processes.
Maybe a dynamic logpoint can help you analyse the code in the productive environment:https://blogs.sap.com/2020/04/21/adt-abap-debugger-what-to-do-if-your-program-does-not-stop-at-breakpoints/