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: 

pricing routine

Former Member
0 Kudos

Hi folks,

i have below requirement, i need to write teh code for teh below requirement in routine.

1.Get the Billing Document numbner.

2.Through document flow get the Sales Document number and document type.

3.Check if the Document type is Proejcts Order type.

4.If the Sales Document type is Projects Related then send the return code 4 .

to reach the above requirement, how can i write the code in pricing routine, could any one help me on this,

thanks in advance.

6 REPLIES 6

Former Member
0 Kudos

goto VOFM tocode

in menu bar

Requirments --> Pricing

under this check routine.

Former Member
0 Kudos

Hi Write code like this in form and endform..


sy-subrc = 4.

IF KOMP-KPOSN NE 0.
          CHECK : KOMK-VBTYP = 'your document type'.
        ENDIF.

        SY-SUBRC = 0.

Put a break point and see..

Regards,

Omkaram.

Edited by: Omkaram Yanamala on Sep 1, 2008 12:00 PM

0 Kudos

hi omkar thanks for ur reply still i need soem clarity on this,

i want correct code basing in the below conditions

here iam giving lines which i got.. we need to write basing on those,

Select the VBRK-VBELN

Get the VBFA-VBELV where VBFA-VBTYP_V = u2019Cu2019, VBFA-VBTYP_N = u2018Mu2019 and VBFA-VBELN= VBRK-VBELN

Get the Document type of the Sales Document seleted in VBFA table.

Select VBAK-AUART where VBAK-VBELN = VBFA-VBELV

If the selected Sales Document type is equal to Projects (ZOFC, ZFSO or ZFPO) send the error code 4

0 Kudos

then write like this..


IF  KOMK-VBTYP = 'C' OR KOMK-VBTYP = 'M'.
SELECT     AUART
            INTO LV_AUART
            FROM VBAK
           WHERE VBELN = KOMP-AUBEL.

SY-SUBRC = 0.

CHECK LV_AUART = 'ZOFC' OR LV_AUART= 'ZFSO'
       OR LV-AUART = 'ZFPO'.

SY-SUBRC = 4.

ENDIF.

Regards,

Omkaram.

0 Kudos

hi omkaram,

thanks again for ur help on this

one more small modification in this, the whole logic should applicable for Sales Organization 1010 through 1080 only.

do the needful

Former Member
0 Kudos

HI,

you have to create one routine(as Omkaram says)

But your routine need to be configure by ur functional or basis people, then only u can able to debug it.

Thanks,

Sendil.