‎2020 Oct 22 9:30 AM
Hey Everyone,
i am tasked with building a new Sap Script. When you print your Production Order (Not sure if its the correct word, its in the T-Code CO03) the Script should get printed.
If i understand correctly, you need to have a print program and a form, you can assign those in the OPK8.
But how do i get the AUFNR / other values of the current Production Order?
e.g. when i go into CO03 and enter AUFNR 1234 and hit print, how can i get the number 1234 inside of my abap code/form.
Any help would be appreciated!
Regards, Kevin
‎2020 Oct 23 7:02 AM
SAPScript in one word is the Form tool used in SE71.
The memory of the print program & the Form is shared.
In the print program, you will catch information of the CO03 (maybe just the key of the object). And you have to write Form routine to get all the data to be printed in the form. All these data needs to be global. And in the form you just have to used them.
What I really suggest, is to copy a standard print program of this transaction, and to rewrite or adapt the form. I know a lot of developer going made to try doing SAPScript from scratch.
Good luck
‎2020 Oct 23 4:30 AM
Hello Kevin,
as far as I understand you correctly you want to execute an SAP GUI Script from ABAP. You can find here a possibility to realize that. On this way you can also use any GetProperty call.
Best regards
Stefan
‎2020 Oct 23 6:49 AM
Hey st.schnell ,
thanks for your answer!
But i am not looking for VB Scripts, i want the Sap Scripts/Forms you can make in SE71.
Regards,
Kevin
‎2020 Oct 23 7:02 AM
SAPScript in one word is the Form tool used in SE71.
The memory of the print program & the Form is shared.
In the print program, you will catch information of the CO03 (maybe just the key of the object). And you have to write Form routine to get all the data to be printed in the form. All these data needs to be global. And in the form you just have to used them.
What I really suggest, is to copy a standard print program of this transaction, and to rewrite or adapt the form. I know a lot of developer going made to try doing SAPScript from scratch.
Good luck
‎2020 Oct 23 7:15 AM
Hey frdric.girod ,
thanks for your answer!
There is a Z print Program which is currently used for printing something from the CO03, sadly the author does not work here anymore.
In that Program, "lcodrinc" gets includes, which uses
IMPORT ITAB
ITAB_TDR FROM MEMORY ID 'PPI'.to get the data. But before i just blindly copy that, i would like to know what it means/how it works/why it works.
‎2020 Oct 23 7:18 AM
In the standard transaction, or in a user-exit, there is a code that put the content of this internal table in the memory with the name PPI.
It's a way to put data in a global memory (at LUW level). Honestly it is little bit old school (as the SAPScript).
You could find the list of this memory, using the debugger.
If your Form is not different from the previous form. Copy the print program with specific includes & the form.
‎2020 Oct 23 1:35 PM
ID List SAPscript Form Print Program
LF01 PRT Overview PSFC_STD_LAYOUT PSFCPRT
LG01 Object List PSFC_PRINT_LAY PSFC_OBJECT_LIST
LG02 Operational Control Ticket PSFC_STD_LAYOUT PSFCOPCT
LG03 Job Ticket PSFC_STD_LAYOUT PSFCJOBT
LG04 Kanban Card PSFC_KANBAN PPPRKANB
LK01 Pull List PSFC_STD_LAYOUT PSFCPICK
LK02 Goods Issue Slip PSFC_STD_LAYOUT PSFCGISS
LK03 Receipt List PSFC_STD_LAYOUT PSFCGRCL
LV01 Time Ticket PSFC_STD_LAYOUT PSFCTIME
LV02 Confirmation Slip PSFC_STD_LAYOUT PSFCCONF
LV03 Document Links PSFC_DOC_LINKS PSFC_DOCLINK_LIST
LV04 Operation Splitting PSFC_STD_LAYOUT PSFCSPLT
‎2020 Oct 29 2:42 PM
Thanks everyone for your help!
This is the solution that i ended up using:
1. Go to Transaction OPK8
2. Go to Forms/Print programs and enter your Form name and Program name respectively
3. In your Program, import ITAB from memory id 'PPI'
4. Now the data is in ITAB and you can use it inside your Print program or Form
‎2020 Oct 23 8:47 AM
Hello Kevin,
sorry for this misunderstanding 😉
Best regards
Stefan
‎2020 Oct 23 1:21 PM
Kevin, the mistake you did is that you tagged your question with UI SAP GUI for Windows, which is for SAP GUI Scripting (not your question). For SAPScript, just tag it ABAP, it should be fine.
‎2020 Oct 29 10:19 AM
Hey sandra.rossi , thanks for clarifying!
I removed the tag, sorry for the mistake.
‎2020 Oct 29 1:40 PM
No problem. As I guess your question is answered, don't hesitate to write a little feedback to the accepted answer, then close the question.