Application Development and Automation 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: 
Read only

RSNAST00 - Selection screen

Former Member
0 Likes
2,199

Hi!

I need to call program RSNAST00 with selection of 2 output types for the same object key (vbeln). Is that even possible?

When I select using a low and high value like below, only the output for kschl-low is created.

wa_range_tab_kschl-sign = 'I'.
wa_range_tab_kschl-option = 'EQ'.
wa_range_tab_kschl-low = 'Z001'.

wa_range_tab_kschl-high = 'Z002'.
APPEND wa_range_tab_kschl to range_tab_kschl.

I tried to execute the program manually with the same selection and just the same, only the first output type is created and I get the message: Object is blocked for the second output type.

The creation of output is actually trigerred by a workflow, and I need that both outputs are created upon approval using a workflow decision. I'm not really sure how to proceed further. Need an expert advise. Thanks!

- Cholen

6 REPLIES 6
Read only

Former Member
0 Likes
1,345

Cholen,

It is possible to process 2 messages for the same document and with same status.

Std program loops around each NAST record, lock it at beginning of processing and unlocks it before going to the next record. So, technically possible to process 2 messages for the same doc.

Pleas check subroutines - perform objekt_sperren using retcode ' '. (ENQUEUE) and

perform objekt_entsperren ( DEQUEUE).

I noticed that right before unlocking, SAP does COMMIT WORK and WAIT for kappl = 'WT' stating 'WT has 2 message for the same doc' and for other's it just uses COMMIT WORK. I guess delayed updates could be reason why SAP uses WAIT. Could you try the same using an Implicit enhancement at the start of routine  objekt_entsperren? (Just a thought)

Hope this helps,

Thanks,

VM

Read only

Former Member
0 Likes
1,345

use fm wfmc_messages_process,to process the o/p sequentially.

Read only

0 Likes
1,345

Do you have a suggestion how I can use fm WFMC_MESSAGES_PROCESS?

The existing inlcude program that runs RSNAST00 looks like below.

wa_range_tab_kappl-sign = 'I'.
wa_range_tab_kappl-option = 'EQ'.
wa_range_tab_kappl-low = 'V3'.
APPEND wa_range_tab_kappl to range_tab_kappl.


wa_range_tab_objky-sign = 'I'.
wa_range_tab_objky-option = 'EQ'.
wa_range_tab_objky-low = a_vbeln.
APPEND wa_range_tab_objky to range_tab_objky.

wa_range_tab_kschl-sign = 'I'.
wa_range_tab_kschl-option = 'EQ'.
wa_range_tab_kschl-low = 'Z001'.
APPEND wa_range_tab_kschl to range_tab_kschl.


SUBMIT rsnast00
WITH s_kappl IN range_tab_kappl
WITH s_objky IN range_tab_objky
WITH s_kschl IN range_tab_kschl
AND RETURN.

Read only

0 Likes
1,345

check this:

Create an internal table and work area of type nast.

·         Declare a work area of type nast

2 Now assign values to the work area.

       wa_nast-mandt  = sy-mandt.
       wa_nast-kappl  = <appropriate value>.”Application area

       wa_nast-objky  = <appropriate value>.”object key. Po, shipment etc

       wa_nast-kschl  = <output type>.”output type to be processed 

     wa_nast-spras  = <appropriate value>.”language

        wa_nast-parnr  = <appropriate value>.”message partner 

       wa_nast-parvw  = <appropriate value>.”partner function  

      wa_nast-erdat  = sy-datum.”current date

      wa_nast-eruhr  = sy-uzeit.”current time  

      wa_nast-nacha  = <appropriate value>.message transmission medium

        wa_nast-anzal  = ‘01’.”number of messages    

    wa_nast-vsztp  = <appropriate value>.”Dispatch time  

      wa_nast-vstat  = ‘0’.”processing status

U can also put a select and retrieve the values from nast table and put them in an internal table to process them.

3 Now Update the NAST table with the fm 'RV_MESSAGE_UPDATE_SINGLE'

           call function 'RV_MESSAGE_UPDATE_SINGLE'
              exporting
                msg_nast = wa_nast. “work area of type nast

4 Process the output type using the fm 'WFMC_MESSAGES_PROCESS'

    • Declare an internal table of type msg0 for tx_messages
    • Declare a work area of type msg0
    • Declare an internal table for tx_display
    • Move the work area of nast to work area of msg0 and then append the values to internal table

Now call the FM by passing the above parameters.    

     call function 'WFMC_MESSAGES_PROCESS'
     
exporting
        pi_display_id       =
'NALIV2'
        pi_no_dialog        =
'X'
     
tables
       tx_messages          = lt_msg_nast
“internal table of type msg0       tx_display           = t_disp.   “internal table of type naliv2

Read only

Former Member
0 Likes
1,345

Hi Cholen Tuna,



Change option from EQ to BT.


wa_range_tab_kschl-sign = 'I'.
wa_range_tab_kschl-option = 'BT'.
wa_range_tab_kschl-low = 'Z001'.

wa_range_tab_kschl-high = 'Z002'.
APPEND wa_range_tab_kschl to range_tab_kschl.

Read only

0 Likes
1,345

I tried wa_range_tab_kschl-option = 'BT' but only the first output type was created.