Application Development 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: 

Run an ABAP code from Notepad

Former Member
0 Kudos

Hello Experts,

I have created a standard ABAP code in SE38, one of my requirements is to be able to run codes that are stored in Notepad, I have used the READ DATA SET to read the contents of the Notepad, but how can I execute it?

3 REPLIES 3

Former Member
0 Kudos

Hi,

Write a logic to pick the code from the notepad and generate a dynamic program from within the ABAP and then try submitting the report.

Btw whats the requirement for such a utility?

Cheers

VJ

Former Member
0 Kudos

Hi,

You would need SAP BASIS to run the ABAP code for you. The maximum you can do is to create programs using the code in the NOTEPAD and execute it.

Regards,

Ravi

Note : Please mark the helpful answers

Former Member
0 Kudos

HI

GOOD

TRY OUT THIS LOGICS

DATA FNAME(60) VALUE 'myfile'.

DATA: TEXT1(12) VALUE 'abcdefghijkl',

TEXT2(5),

LENG TYPE I.

OPEN DATASET FNAME FOR OUTPUT IN BINARY MODE.

TRANSFER TEXT1 TO FNAME.

CLOSE DATASET FNAME.

OPEN DATASET FNAME FOR INPUT IN BINARY MODE.

DO.

READ DATASET FNAME INTO TEXT2 LENGTH LENG.

WRITE: / SY-SUBRC, TEXT2, LENG.

IF SY-SUBRC <> 0.

EXIT.

ENDIF.

ENDDO.

CLOSE DATASET FNAME.

-


DATA FNAME(60) VALUE 'myfile'.

DATA: TEXT1(4) VALUE '1234 ',

TEXT2(8) VALUE '12345678',

TEXT3(2),

LENG TYPE I.

OPEN DATASET FNAME FOR OUTPUT IN TEXT MODE.

TRANSFER: TEXT1 TO FNAME,

TEXT2 TO FNAME.

CLOSE DATASET FNAME.

OPEN DATASET FNAME FOR INPUT IN TEXT MODE.

DO 2 TIMES.

READ DATASET FNAME INTO TEXT3 LENGTH LENG.

WRITE: / TEXT3, LENG.

ENDDO.

CLOSE DATASET FNAME.

thanks

mrutyun