09-01-2008 6:31 AM
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.
09-01-2008 7:17 AM
goto VOFM tocode
in menu bar
Requirments --> Pricing
under this check routine.
09-01-2008 7:29 AM
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
09-01-2008 8:42 AM
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
09-01-2008 8:53 AM
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.
09-01-2008 10:56 AM
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
09-01-2008 8:01 AM
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.