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: 

How to transfer the exact screen to application log?

Former Member
0 Kudos

Hi everyone,

I know i can use keyword 'Transfer' to write the data to application log.  Right now i can only transfer the data within workarea to application log with no  header and others important info.

However, i want it to be exact like the picture below. Is it possible?



If it is possible, how can i do it?

15 REPLIES 15

Former Member
0 Kudos

Vong,

I guess you are referring to logs present in AL11. The data that you see in AL11 and the term application log are 2 different things. Generally when you use the term application logs it refers to the logs you see in the transaction SLG1. Logs in SLG1 are not added using "TRANSFER".

In order to transfer data to AL11 with the header information, before you loop and transfer the contents of the work area, just add another TRANSFER which contains the header information.

After the loop to add the contents of the work area, add another TRANSFER with the trailer information.

V.

0 Kudos

Hi Vikram,

Yes, i am referring to AL11.
Thanks.

One more thing, is it possible to have the same log file name without overriding the old log?

0 Kudos

I have not personally tried it but I assume it will not be possible. The reason being if you try you do an OPEN data set, the system will not know which dataset to open if there are more than one.

But it is possible to update the contents of the dataset either by updating its contents or appending new contents.

V.

former_member182550
Active Contributor
0 Kudos

Why would you want to update the system logs when it looks like an application you are running ?

the logs defined by SBAL and SLG1 are where you should be storing application logs.  You will also find that there are facilities to be able to store just this type of information in an Application log.

0 Kudos

I dont think Vong wants to update system logs. There is no mention about updating system logs.

V.

0 Kudos

I assumed he was on about the logs in DIR_HOME or DIR_LOGGING viewable by transactio AL11.

Regards,

Rich

0 Kudos

Hi Vikram.

I know how to write the text into file and store for viewing in AL11.
However, my problem is how can i concatenate or place the text in a specific position like the picture above.

0 Kudos

sophanith vong wrote:

However, my problem is how can i concatenate or place the text in a specific position like the picture above.

You might want to explain in simple words what you are trying to do in general. Otherwise I believe mentioning of "screen" and "log" etc. is just confusing everyone.

Based on the cryptic information given so far I can only guess that this is a simpler task of creating a plain text file from a program that does some kind of an update and runs in a background job (hence - no GUI or actual "screen"). Not sure what is the major importance of the specific text format and why simply having messages in the job log is insufficient, but what exactly have you tried before posting the question on SCN? Because there is CONCATENATE command with RESPECTING BLANKS addition, for example (it's described in Help). There are also structures in ABAP. So what is the specific technical challenge?

Jelena
Active Contributor
0 Kudos

TRANSFER writes a line into a file. 'Application log' is a different thing - look at the programs SBAL_DEMO*.

I'm also confused by the statement "right now I can only...". If it's a custom program then what is preventing you from capturing the needed information in an internal table and then writing it to a file or application log or whatever?

Have you read ABAP Help on how to work with the files? It's already explained there how to add to the files, etc. Not sure why such question requires assistance from SCN...

former_member184158
Active Contributor
0 Kudos

Hi,

1. you can do this, by using FM 'BAL_LOG_CREATE',  BAL_LOG_MSG_ADD', and other FM, to write it in log file.,

2. You can create your own structure and display the result in your report,  but in SLG1, applicaion log not , it will show only the message, becuse SLG1 has own structure BAL_S_SHOW,

in this case, you can only add your message, I mean you can add all your informations as message, and you can see it , one record has many rows, or concatante them in one message separated by space,

Try to take a look to this program SBAL_DEMO_02 , maybe it could help you .

Regads

Ibrahim

0 Kudos

Which is basically what I was saying.

0 Kudos

Hi Richard,

you have said it in one sentence, but I have declared it in details   with more explanation

Regards

Ibrahim

0 Kudos

That may be true Ibrahim,  however,  I like to hope that people are willing to put some effort into their solution themselves and possibly learn  more at the same time.

On top of that there is always the scenario of 'Well - I didn't know you could do that!!!' when you are digging around for yourself rather than following instructions given by some one else.  Infact,  I quite like Raymonds answer below....


Sage Raymond Said:

So a solution could be

•Save current screen to some file (read screen with method

CL_GUI_FRONTEND_SERVICES=>GET_SCREENSHOT)

•Create a log, read some of the available online documentation (*), and insert a link to screenshot (file name that store it)

Regards,

Raymond

(*) Application Log (BC-SRV-BAL), Application Log - Guidelines for Developers (BC-SRV-BAL) : Function Module Overview.

0 Kudos

Hi Richard,

you are absolutely true, this is what happens with us every day, when I have a question, or when I stuck in a problem, I go to my project manager, and he says, use FM, or method,,. sometimes says take a look at that class ABC, and you will find the solution , and then I  dig and dig, until I find it.

Thank you again fot this info.

raymond_giuseppi
Active Contributor
0 Kudos

So a solution could be

  • Save current screen to some file (read screen with method CL_GUI_FRONTEND_SERVICES=>GET_SCREENSHOT)
  • Create a log, read some of the available online documentation (*), and insert a link to screenshot (file name that store it)

Regards,

Raymond

(*) Application Log (BC-SRV-BAL), Application Log - Guidelines for Developers (BC-SRV-BAL) : Function Module Overview.