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: 

Assigning new o/p type to item deleting other Unprocessed O/P[RESOLVED] !

dp_prasad
Participant
0 Kudos

Hi

I have created a Program to create an output type for a Sales Order item .,and when we run this program it will send some flag to output routine, to make sure that it wont be assigned automatically. When we run our program it is assigning the new output type to the item ( in unprocessed state).

<u>But</u> ..<b>its deleteing</b> the all other output types(diffrent output types) which are unprocessed.( status yellow)

I debug the Program and found out that ,

<b>Messaging</b> function module calling the include <b>LV61BF0</b>N( form (FORM <b>NNAST_UEBERNEHMEN</b> USING, <b>Line -578</b>), and wherein its updating the xnast-updat = 'D'., SO subsequently <u>RV_MESSAGES_UPDATE</u> is excluding these output types which has value 'D'.

<b>A</b>nybody experienced similiar Kind of problem..? any Advise..? <u>Thanx a lot</u> .

My <b>Code</b> looks like this :which assigns output type

        EXPORT flag FROM flag TO MEMORY ID flagid .
        SELECT SINGLE * FROM vbak INTO vbak 
               WHERE vbeln EQ itab-vbeln.

        SELECT * FROM vbkd INTO TABLE xvbkd
          WHERE vbeln EQ itab-vbeln.

        READ TABLE xvbkd INTO xvbkd INDEX 1.
        na_vbkd = xvbkd.

        CALL FUNCTION 'SD_PARTNER_READ'
             EXPORTING
                  f_vbeln  = vbak-vbeln
             TABLES
                  i_xvbadr = xvbadr
                  i_xvbpa  = xvbpa.

        SELECT * FROM vbap INTO TABLE xvbap
            WHERE vbeln  = itab-vbeln
            AND posnr   = itab-posnr
            ORDER BY PRIMARY KEY.
        CLEAR xvbap.
        READ TABLE xvbap INTO  xvbap INDEX 1.
SELECT SINGLE * FROM vbuk INTO vbuk  WHERE vbeln   =              itab-vbeln.
 SELECT SINGLE * FROM vbup INTO vbup WHERE vbeln = itab-vbeln  AND posnr = itab-posnr.
 SELECT SINGLE * FROM tvap INTO tvap WHERE  pstyv = xvbap-pstyv.

        MOVE xvbap-vbeln TO xobjky.
        MOVE xvbap-vbeln TO xobjky_to.
        MOVE xvbap-posnr TO xobjky_to+10.
        CALL FUNCTION 'RV_MESSAGES_READ'
             EXPORTING
                  msg_kappl    = 'V1'
                  msg_objky    = xobjky_to
                  msg_objky_to = xobjky_to.

        CALL FUNCTION 'COMMUNICATION_AREA_KOMKBV1'
             EXPORTING
                 msg_old   = ' '
                  msg_trtyp = ' '
                  msg_vbak  = vbak
                  msg_vbkd  = na_vbkd
                  msg_vbuk  = vbuk
             TABLES
                  tab_part  = part
                  tab_vbpa  = xvbpa
                  tab_vbap  = xvbap.

        SELECT SINGLE * FROM vbap INTO vbap
            WHERE vbeln  = it_data-vbeln
            AND posnr   = it_data-posnr.

*
*        CALL FUNCTION 'COMMUNICATION_AREA_KOMPBV1'
*          EXPORTING
**            msg_old        = ''
*            msg_vbap       = vbap
**            msg_vbkd       = na_vbkd
*            msg_vbup       = vbup
**   MSG_VBAK       =
*          TABLES
*            tab_part       = part
*            tab_vbpa       = xvbpa
*                  .


        CALL FUNCTION 'MESSAGING'
             EXPORTING
                  applikation = 'V1'
                  msg_objky   = xobjky_to
                  schema      = tvap-kalsm
                  pi_objtype  = 'VBAP'
                  pi_item     = 'X'
             TABLES
                  msg_part    = part.

        CALL FUNCTION 'RV_MESSAGES_UPDATE'
             EXPORTING
                  msg_kappl = 'V1'
                  msg_objky = xobjky_to.

        COMMIT WORK  AND WAIT.

Message was edited by:

Deadlock1

2 REPLIES 2

dp_prasad
Participant
0 Kudos

Any Help or Hints for this..? Thanx a lot !

0 Kudos

Forgot to write the solution , after i resolved the issue.

This can be done in the output type routine. before setting the sy-subrc to 4 , check if that item already have an unprocessed o/p type , if so set sy-subrc = 0.

This resolved my Query.