‎2008 Aug 22 10:35 AM
hi frnds,
MY SELECTION SCREEN
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-T00.
PARAMETERS : P_VBELN LIKE VBAK-VBELN.
P_SDOCU LIKE VBAK-VBELN.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-T01.
PARAMETERS : P_KUNNR LIKE KNA1-KUNNR,
P_NAME1 LIKE KNA1-NAME1.
P_KUNAG LIKE VBRK-KUNAG.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN PUSHBUTTON 33(10) PUBU USER-COMMAND US01.
SELECTION-SCREEN END OF BLOCK B2.
if i enter the billing doc number in the selection screen then customer and customer name comes automatically. i want that
If user enters the billing doc and then clears it from the input screen then customer and customer name should also disappear.
‎2008 Aug 22 10:39 AM
Hi,
Try this.
Write the code in the AT SELECTION SCREEN ON <billing document field name>
AT SELECTION SCREEN ON <billing document selection screen field name>
if <billing document selection screen field name> is initial.
clear the other fields as per your requirement.
else.
fetch the data from the table and assign it to the selection screen fields.
endif.
Sharin.
‎2008 Aug 22 10:47 AM
Hi Daniel,
Try it like this:
DATA:
W_KUNNR like KNA1-KUNNR,
W_NAME1 LIKE KNA1-NAME1.
AT SELECTION-SCREEN.
If P_VBELN is not initial.
select SINGLE KUNNR
from VBAK
into W_KUNNR
where VBELN EQ P_VBELN.
if sy-subrc = 0.
select SINGLE NAME1
from KNA1
into W_NAME1
where KUNNR EQ W_KUNNR.
P_KUNNR = W_KUNNR.
P_NAME1 = W_NAME1.
endif.
elseif P_VBELN is INITIAL.
CLEAR P_KUNNR.
CLEAR P_NAME1.
endif.You can do the same logic in
AT SELECTION-SCREEN OUTPUT event also (its the PBO event in selection screen).
With Regards,
Pritam.
‎2008 Aug 22 10:49 AM
‎2008 Aug 22 10:50 AM
Hi Daniel,
In the At Selection-Screen Output event, In the Screen table do the necessary changes. As per your requirement you are not allowing the user to enter the KUNNR and NAME directly so you can make this fields input disabled.
Regards,
Swapna.
‎2008 Aug 22 10:50 AM
hi Danial
AT selection-screen on p_vbeln
Select single kunnr from vbak into P_kunnr where vbeln = p_vbeln.
Select single name1 from kunnr into p_name1 where kunnr = p_kunnr.
And use Keyword CLEAR to clear the contents
With Regards..
Always Learner
‎2008 Aug 22 11:00 AM
Hi,
try this way :
AT SELECTION-SCREEN.
If p_vbeln is not initial.
select single kunnr
from vbak
into l_kunnr
where vben eq p_vbeln.
if sy-subrc = 0.
select single name1
from kna1
into l_name1
where kunnr eq l_kunnr.
p_kunnr = l_kunnr.
p_name1 = l_name1.
endif.
elseif p_vbeln is INITIAL.
clear p_kunnr.
clear p-name1.
endif.
hope this helps.
thanx,
dhanashri
‎2008 Aug 22 11:13 AM
Try this code.
DATA: w_kunnr LIKE kna1-kunnr,
w_name1 LIKE kna1-name1.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t00.
PARAMETERS : p_vbeln LIKE vbak-vbeln.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-t01.
PARAMETERS : p_kunnr LIKE kna1-kunnr,
p_name1 LIKE kna1-name1.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN PUSHBUTTON 33(10) pubu USER-COMMAND us01.
SELECTION-SCREEN END OF BLOCK b2.
AT SELECTION-SCREEN ON BLOCK b1.
IF p_vbeln IS NOT INITIAL.
SELECT SINGLE kunnr FROM vbak INTO w_kunnr WHERE vbeln EQ p_vbeln.
SELECT SINGLE name1 FROM kna1 INTO w_name1 WHERE kunnr EQ w_kunnr.
p_kunnr = w_kunnr.
p_name1 = w_name1.
ENDIF.
AT SELECTION-SCREEN ON BLOCK b2.
IF p_vbeln IS INITIAL.
CLEAR : p_kunnr, p_name1.
ENDIF.
Edited by: Bala Krishna on Aug 22, 2008 3:44 PM
‎2008 Aug 22 1:34 PM