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: 

Help with priicng routines and access sequence

Former Member
0 Kudos

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

2 REPLIES 2

Former Member
0 Kudos

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.

0 Kudos

Hi.. thanks for the reply but i can't quite understand the codes. Can you please be kind to explain what your codes do? thanks so much.

Janine