cancel
Showing results for 
Search instead for 
Did you mean: 

Stand-alone program to generate SAPScript Pick List output

former_member367551
Participant
0 Kudos

Dear experts,

I need advice on how I can successfully execute an existing SAPScript form (Pick List based on process orders) from a stand-alone executable report program. Here's what I have done:-

1) Create a new stand-alone executable report program that allows the user to input the desired process orders

2) The new stand-alone program should check and validate the process orders that are specified by the user

3) The new stand-alone program will allow the user to click on a "Print Pick List" button for the selected process orders that have passed the validation criteria

4) The issue that I am facing is in the printing functionality of the Pick List here

In the existing Pick List print program, it executes the include program, LCODRINC that imports all the required data concerning the process order. However, I am unable to use this same approach, because the new stand-alone program is executed separately from any memory sessions of any process orders. Any ideas on can I resolve this issue?


P/S:

I have tried to manually retrieve data from data dictionary tables, but there are still some crucial data missing here, i.e. "ITAB" and "ITAB_TEMP" as per the include program, LCODRINC.


Appreciate any input at all. Thanks.


Deborah

Accepted Solutions (0)

Answers (1)

Answers (1)

janbuchmann
Contributor
0 Kudos

Hi

My advice would be not to make it "too stand-alone". The print environment gives you all the data you will need on a silver plate. You should make use of it rather than trying to determine everything yourself. Therefore:

  • Maintain SAPscript form and print program in CB85 as per normal
  • Create your new report in which you can do your checks & validations and which contains a "Print Pick List" button
  • Upon "Print Pick List" call function module CO_DR_PRINT_ORDER_EXTERNAL
  • In CB85 under "List control for transactions" you can even restrict it further to only print this pick list for the tcode of your new report, if needed

Jan

former_member367551
Participant
0 Kudos

Hi Jan,

Thanks for the input, appreciate it a lot.

I wish to clarify, that my requirement is for process orders - so, when I tried executing the FM, CO_DR_PRINT_ORDER_EXTERNAL, it ended in an error.

After specifying 'COPI' as the TCODE parameter for this same FM, it still ended in an error - "bad_status_of_order". Any further idea on how I can get the data that is needed here?

janbuchmann
Contributor
0 Kudos

Hi Deborah

CO_DR_PRINT_ORDER_EXTERNAL works for process orders as well. The error you are getting relates to the print mode. If you are reprinting (i.e. an order which was already printed and has status PRT), choose DRART = 'N'. Otherwise, choose DRART = 'O'. I think you will also have to set READ_ORDER = 'X'. Not sure though if you need to set LOCK_ORDER or not.

Jan