Creating Custom Screen in XD01

Previous

Populating the data into our custom fields

By Lokesh Reddy Avutu, YASH Technologies

Add the following code to the program SAPLZSURESHKUMAR, screen number 1111.

MODULE STATUS_1111 OUTPUT.
*  SET PF-STATUS 'xxxxxxxx'.
*  SET TITLEBAR 'xxx'.
*
data:
l_oldcustno type kna1-zzold_cust_no.
constants: c_oldcustno(24)  value '(SAPMF02D)KNA1-ZZOLD_CUST_NO'.
  field-symbols: <fse>.
  assign (c_oldcustno) to <fse>.
  if sy-subrc = 0.
    l_oldcustname = <fse>.  "l_oldcustname is the screen name of old cust field
  endif.
 If sy-tcode = 'XD03'.
	Loop at screen.
		If screen-group1 = 'PSK'.
			Screen-input = 0.
			Modify screen.
		Endif.
	Endloop.
 Endif.
ENDMODULE.                      "STATUS_1111 OUTPUT

Saving the data back to database from screen field

In the interface IF_EX_CUSTOMER_ADD_DATA_CS, add the following code in the method GET_DATA

method IF_EX_CUSTOMER_ADD_DATA_CS~GET_DATA .
data:l_zztest type kna1-zztest.
constants: c_oldcustno(24)  value '(SAPLZSURESHKUMAR)l_oldcustname'.
  field-symbols: <fse> type any.
  assign (c_oldcustno) to <fse>.
  if sy-subrc = 0.
    s_kna1- ZZOLD_CUST_NO = <fse>.
  endif.
endmethod.

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image