Skip to Content
0
Jan 30, 2008 at 09:23 AM

Attention: WOLFGANG VALTIN Re: VA01 Enhancement

35 Views

Hello Wolfgang,

Thanks for the info, i found the part where i should place the validation.. apologies for marking this question as unanswered, your info is very helpful.

I do have another question for if You dont mind..

In the previous enhancement of VA01, the PO number (fxvbkd-bstkd) which was entered in the 'PO Number' field in 'Create Direct - Pull Out: Overview' screen, is being checked if it has been used before. Pls. See Codes:

METHOD if_ex_badi_sd_sales~save_document_prepare.

DATA: wa_fxvbkd TYPE vbkd,

v_bstnk TYPE vbak-bstnk.

IF fvbak-auart = 'ZDRE' OR

fvbak-auart = 'ZORE' OR

fvbak-auart = 'ZOKA' OR

fvbak-auart = 'ZMKA'.

READ TABLE fxvbkd INTO wa_fxvbkd INDEX 1.

Check if RRC number is already used

SELECT SINGLE bstnk FROM vbak INTO v_bstnk WHERE ( auart = 'ZDRE'

OR auart = 'ZORE'

OR auart = 'ZOKA'

OR auart = 'ZMKA' )

AND bstnk = wa_fxvbkd-bstkd.

IF sy-subrc = 0.

MESSAGE e002(z_msg) .

ENDIF.

ENDIF. "IF fvbak-auart = 'ZDRE' OR

ENDMETHOD.

What I need to add now is check PO Number is within the Range the user defined AND it is for a particular Forwarder.

The range is maintained in a user defined/maintained table which i already created, it has 4 fields (Forwarder, From, To, Company Code). I have to dissect the PO number that the user entered (FOxxxxxxxxxx) into 2 parts, the first part is for the 'FO', which is validated against the Company Code field of the user defined table and the 2nd part 'xxxxxxxxxx' should be validated if it is between the From and To field of the user-defined table. Now, in the screen 'Create Direct - Pull Out: Overview' there is a button for 'Display doc. Header Details', i clicked on this button right after entering the necessary data. The screen 'Create Direct - Pull Out: Header Data', I go to the 'Partners' Tab to fill out the 'partner function' and the 'Partner' field. The question is, how do i capture the value entered in the 'Partner' field? so i can validate it against the 'Forwarder' field of the user-defined table. The over all condition for the transaction to save should be:

IF the PO number has NOT been used before (this is the previous enhancement).

In my enhancement:

IF the value entered (Trucker) in the 'Partner' field exists in the user defined table AND if that value (Trucker) has a 'Company Code' that is equal to the first 2 characters entered (FO) by the user AND if the last 10 characters of the PO number is between the From and To fields of the user-defined table that has a Forwarder value of (Trucker) and Company Code (FO).

My question is quite long. I do Hope you can help me...

Thanks,

Frank