2011 Mar 22 2:33 PM
I had a scenario, when I create a sales order manually using VA01 tcode, I enter sold to and ship to and then line items and save it.
But when i am in Va02 for the same sales order, I am getting information message that Enter the Sold to Party and Sold to is disabled and I cannot enter the value in it now.
But in VBAK-KUNNR , the sold to party is filled with value. In VBPA ( Partner function table), there is only Ship-to , and sold to is not available in VBPA table .
I debugged in MV45AFZZ and MV45AFZB, but unable to figure out where Partner function with AG or sold to gets deleted.
2011 Mar 23 12:02 PM
Hi
It doesn't happen generally but if it is happening then it is but obvious that someone has applied some exit or enhancement for va02.
and if you want to see the Sold-to, Ship-to validation,
Then, for that, the table is ' KNVP ' .
From this table only, ship-to is fetched for corresponding sold-to.
and other validations are done.
Look for this kind of code in standard,
this is code for Ship-to ,sold-to validation...
in your case, enhancement may be present at it.
CODE::
IF V_KUNNR_SP IS NOT INITIAL.
SELECT SINGLE KUNNR FROM KNVP INTO V_KUNNR1 "VALIDATION FOR SOLD TO PARTY IN CUSTOMER MASTER.
WHERE
KUNN2 = V_KUNNR_SP
AND PARVW = C_SP.
IF SY-SUBRC <> 0.
MESSAGE E008 WITH V_KUNNR_SP.
CLEAR V_KUNNR1.
ENDIF.
ENDIF.
IF V_KUNNR_SP IS INITIAL AND V_KUNNR_SH IS INITIAL. " VALIDATION IF SOLD TO PARTY
MESSAGE E012. " AND SHIP TO PARTY IS LEFT BLANK
ELSEIF V_KUNNR_SP IS INITIAL AND V_KUNNR_SH IS NOT INITIAL.
SELECT SINGLE KUNNR FROM KNVP INTO V_KUNNR1 "SELECT TO FIND CUSTOMER FOR SHIP TO PARTY
WHERE
KUNN2 = V_KUNNR_SH
AND PARVW = C_SH.
IF SY-SUBRC = 0.
SELECT SINGLE KUNN2 FROM KNVP INTO V_KUNNR_SP "SELECT TO FIND SHIP TO PARTY FOR PRIOR CUSTOMER
WHERE
KUNNR = V_KUNNR1
AND PARVW = C_SP.
IF SY-SUBRC <> 0.
MESSAGE I001.
ENDIF.
ENDIF.
V_KUNNR_SP = V_KUNNR_SH.
ELSEIF V_KUNNR_SP IS NOT INITIAL AND V_KUNNR_SH IS INITIAL. "SELECT TO SEE IF SOLD TO PARTY EXISTS FOR
SELECT SINGLE KUNN2 FROM KNVP INTO V_KUNNR1 "GIVEN SALES AREA BY USER
WHERE VKORG = V_VKORG
AND VTWEG = V_VTWEG
AND SPART = V_SPART
AND KUNN2 = V_KUNNR_SP
AND PARVW = C_SP.
IF SY-SUBRC <> 0.
MESSAGE E011 WITH V_KUNNR_SP V_VKORG V_VTWEG.
ENDIF .
SELECT SINGLE KUNNR FROM KNVP INTO V_KUNNR1 "SELECT TO SEE IF SOLD TO PARTY EXISTS FOR
WHERE "GIVEN SALES AREA BY USER
KUNN2 = V_KUNNR_SP
AND PARVW = C_SP.
IF SY-SUBRC = 0.
SELECT SINGLE KUNN2 FROM KNVP INTO V_KUNNR_SH "SELECT SHIP TO PARTY FOR GIVEN SOLD TO PARTY
WHERE "ONLY IS SOLD TO PARTY EXISTS FOR THAT SALES AREA
KUNNR = V_KUNNR1
AND PARVW = C_SH.
IF SY-SUBRC <> 0.
MESSAGE I001.
ENDIF.
ENDIF.
ENDIF.
Regards
Raghav Malhotra