Skip to Content
author's profile photo Former Member
Former Member

Help with priicng routines and access sequence

Hi. Im actually new to abap and i have to do a routine for shipment route in VOFM. I was actually able to create a new one and when i go to SPRO, i can already see the routine i created under requirements column.

Now, i don't know what codes to put in the routine i created. What the SD functional guy told me is that the routine should be able to pick up values from vbap-route field in SAP table so that when he goes to va03 and views the condition records that he setup, the value from sap table will appear.

I hope i was able to get my point accross. I really don't know how to explain this better.

I would really appreciate it if someone could help me.

Thanks,

Janine

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Dec 13, 2007 at 10:31 AM

    hi Janine,

    Please find code for your routine,

    routine name : RV45C902

    FORM DATEN_KOPIEREN_902.
    *{   INSERT         UPEK922075                                        2
    *
    *---------------------------------------------------------------------*
    *       FORM - Routine for data transfer when copying                 *
    *---------------------------------------------------------------------*
    
    *---------------------------------------------------------------------*
    *       FORM DATEN_KOPIEREN_102.                                      *
    *---------------------------------------------------------------------*
    *                                                                     *
    *       Business data of the item to be copied                        *
    *                                                                     *
    *       The following work areas are available:                       *
    *                                                                     *
    *        VBAK - Header of the order                                   *
    *       CVBAK - Header of the reference document                      *
    *        VBAP - Item data of the order                                *
    *       CVBAP - Item of the reference with the new item number        *
    *        VBKD - Business data of the order                            *
    *       CVBKD - Business data of the reference document               *
    *       KUAGV - Sold-to view                                          *
    *       KURGV - Payer view                                            *
    *       KUWEV - Ship-to view                                          *
    *       XVBPA - Partner table                                         *
    *       CVBPA - Partner table of the reference document               *
    *                                                                     *
    *---------------------------------------------------------------------*
    
    *FORM DATEN_KOPIEREN_102.
    
    * Fields which are not copied:
      LOCAL: VBKD-FKDAT.
      LOCAL: VBKD-FPLNR.
      LOCAL: VBKD-WKWAE.
      LOCAL: VBKD-WKKUR.
      LOCAL: VBKD-BSTKD.
      LOCAL: VBKD-RRREL.
      LOCAL: VBKD-ACDATV.
      LOCAL: VBKD-BSTDK.
    
      LOCAL: VBKD-ABSSC.
    
      DATA: DA_FAKTF LIKE VBKD-FAKTF.
    
      DA_FAKTF = VBKD-FAKTF.
    
      IF CVBAP-POSNR IS INITIAL.
        MESSAGE A247 WITH '102'.
      ENDIF.
    
    * Fields which are copied
    
    * Fields that are copied when the sold-to party is the same
    * Read the sold-to party from the reference document
      CVBPA = SPACE.
      CVBPA-PARVW = PARVW_AG.
      READ TABLE CVBPA.
      IF SY-SUBRC = 0 AND                  " kein Musterauftrag
        CVBPA-KUNNR = KUAGV-KUNNR.
        VBKD = CVBKD.
      ENDIF.
    
    * Set the pricing date from the pick-up date in dlv. order processing
      IF CVBAK-VBKLT EQ VBKLT_LP_AUSL_AUFT.
        IF TVAK-VBKLT EQ VBKLT_AUSL_AUFT.
          VBKD-PRSDT = VBAK-ABHOD.
          IF NOT CVBAK-ABHOD IS INITIAL.
            VBKD-PRSDT = CVBAK-ABHOD.
          ENDIF.
        ELSE.
          VBKD-PRSDT = *VBKD-PRSDT.
        ENDIF.
      ENDIF.
    
    * Data which is not copied
    * Pricing date for consignment issue by external service agent from
    * the scheduling agreement
      IF CVBAK-VBTYP CA VBTYP_LP_EDL.
        VBKD-PRSDT = *VBKD-PRSDT.
      ENDIF.
    
    * PO data should not be copied
      CLEAR: VBKD-BSTKD,
             VBKD-BSTDK,
             VBKD-BSARK,
             VBKD-IHREZ,
             VBKD-BSTKD_E,
             VBKD-BSTDK_E,
             VBKD-BSARK_E,
             VBKD-IHREZ_E,
             VBKD-POSEX_E,
             VBKD-PRSDT.
    * VBKD-PRSDT Newly added by Babu 8/12/04
    
    * Assinging current date to price date of target
    * docu. added by Babu 8/12/04
    
      VBKD-PRSDT = sy-datum.
    
    
    * Financial document data will not be taken over
      CLEAR: VBKD-LCNUM,
             VBKD-AKWAE,
             VBKD-AKKUR,
             VBKD-AKPRZ.
    
    * Do not copy the invoice form when creating a repair request
    * from a quotation
      IF CVBAK-VBTYP CA VBTYP_AGAN      AND
         VBAK-VBTYP CA VBTYP_AUFT       AND
         CVBAK-VBKLT CA VBKLT_WART_AUFT AND
         VBAK-VBKLT CA VBKLT_WART_AUFT  AND
         CVBAP-VKGRU EQ VKGRU_REP_REPARATURANFO.
        VBKD-FAKTF = DA_FAKTF.
      ENDIF.
    
    *ENDFORM.
    *eject
    
    *}   INSERT
    ENDFORM.

    Please use this code as per your requirement.....

    This might help you for your transaction...

    Reward points...

    Cheers,

    Sagun Desai.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.