Avoiding html codes and javascript codes in servlets
Are there ways to avoid long html codes using out.println() and also javascript codes in servlets? Can I make a jsp and include that file somehow in the servlet and do the processing. Can I get reference to the fields or components declared in the jsp and also do conditional flow based on the buttons present in that jsp.
Is it possible to include javascript files and instead call that javascript file and also the particular function in that file?
Please also mention disadvantages if any.
Javascript is for the client ONLY. Even if you could find a way to use it on the server side, DON'T.
In my opinion, you should have ZERO logic (except for validation via JavaScript) in your JSP. Have a Servlet do all logic/business rules. The Servlet will create one or more Java Beans that hold ALL dynamic content for a page. Use the Servlets RequestDispatcher to forward the request to the JSP upon completion. The JSP should do nothing more than grab these beans (from the HttpSession object) and fill in the dynamic parts of the page.
By doing it this way, you seperate the logic and presentation. You can add different 'flavors' (WML, XML) by simplying creating a new JSP page that looks for the same Java Beans, but has different template text.
Similar Messages
-
Lost my SIM card's PIN code and PUK code!!!!
I lost my SIM card's PIN codes and PUK code.
Our mobile provider is not helpful. We have to give around $100 to unlock these codes. I cannot spend $100 for it. I'm from Myanmar (Burma).
My phone is Nokia E63. But I still got that problem in all other handsets like; Nokia 6300 and Nokia 1280
Is there any ways to unlock my phone?
Please help me.
QueenieExactly.
Either way round you must remember that the SIM and any codes related to it are the property of your network. THEY control what happens to it.
http://techyoddsandends.blogspot.com/2009/09/pin-code-puk-code-security-code-lock.html
Message Edited by grschinon on 21-Nov-2009 11:44 AM
Was this post helpful? If so, please click on the white "Kudos!" star below. Thank you! -
Hi,
We have an application built using HTMl 5 and Javascript running on IPad2, iOS5.1 Safari 5.1.
When a file url is clicked instead of asking for Save or Open or Cancel options, the file gets opened on IPad by default.
Is this default behaviour which cannot be changed or can it be configured to ask user preference?
When we try to download a file(.pvw file -> a model file) in the above application, safari throws "Download failed" error.
Please suggest what needs to be done.
Regards,
PramodSafari on an iPad in general does not allow downloading of files. That's a safety precaution in the iOS SDK to keep unauthorized content off of iOS devices. Safari will open from the web site file types that it can handle, but direct downloading isn't normal behavior, and I don't believe the behavior can be changed, though you can try asking in the developer forum, either here or the one to which you have access as a member of Apple's iOS developer program.
Regards. -
PO to accept multiple GL codes and cost codes
PO to accept multiple GL codes and cost codes. Since the system POs are not accepting more than one GL code and Cost code, this functionality is not being used for some of the service providers like Car Hire, Air ticket vendors, Stationery vendors, Utility vendors.
Is there anything to releated to field selection ?
is there anyway to upload the excel file in case if I have more than 1 G/L and cost center during PO creation
Thanks in advanceHI
Yes the setting will let you use multiple account assignments.
If you need to upload alot of PO's in this way then the best way is to use the BAPI - BAPI_PO_CREATE1.
This will help you in craeting any number of line items witha nay number of account assignments.
LSMW and BDC will not be able to control the table structures being used.
Please take help of ABAPEer in bulding the program using the BAPI.
Thanks & Regards
kishore -
Hi All,
I need the help of this forum once again.
I am using bapi Bapi_Acc_Document_Post to create KR documents in SAP. The bapi works absolutely fine except for one scenario:
For a particular type of invoice coded to Company "XXXX" with lines having tax code "I0", the bapi returns error message "E 018 : Invalid tax code and company code combination". The tax code "I0" and the company code "XXXX" has been mapped in SAP and if I try to create the invoice manually in SAP using the GUI, the invoice gets created without any issue.
I have tried searching the forum but could not find any post on this topic.
Therefore, requesting the masters to please help me out on this.
Best Regards
Sutirtha RoyHi Gowthami,
how have you solved your problem, because I am facing the similiar issue and trying desperately to post the following combination with BAPI_ACC_POST_DOCUMENT:
001 40 490100 Aufw. aus Marge PP R2 15,92
002 31 10000003 Kreditor R2 15,92-
003 50 175060 Abzugsverfahren USt R2 3,18-
004 40 154060 Abzugsverfahren Vst R2 3,18
THANX!
Regards
Marko -
Importing a journal voucher with GL Codes and BP Codes
Hi Experts,
I'm trying to get a DTW import for Journal Vouchers working on 8.8 PL05. I have a journal voucher template with GL Codes and BP Codes that I need to import as this is part of some integration.
If I leave out the BP Codes it works fine but if I add them into the sheet is gives a DTW error "invalid account code application-defined or object-defined error 65171".
I have tried to add BP code to shortname and add contra account.
Please any help would be appreciated.
Regards
Lou van WykWelcome to SAP forum Lou...
I do not know about 8.8 Journal vouchers, but some time ago we were importing with BP codes and we ran into a somewhat similar situation. I believe we had to format the BP codes to Text in Excel before saving the file to CSV.
Another time I was working with an individual who had not set up two BP Master Data records before doing transactions like it states in SAP's User Guide titled Data Migration and Opening Balances...
Maybe that helps?
Regards,
Zal -
A table mapping between country code and currency code
Hi experts,
I want to know whether there is a table mapping between country code and currency code.I have found the table T005(Countries).But I don't why the filed of WAERS(Country currency) hasn't maintained in talbe T005?Whether country code and currency code hasn't direct relation?
Regards,
KelvinDear Kelvin
The said field (WAERS) can be fetched from many tables. To name a few, below are some of the tables in which, you can see the field for currency.
1) BKKI4
2) BKKI5
3) BWPOS
4) KNKA
5) KNVV
6) MSEG
thanks
G. Lakshmipathi -
Hi Gurus
Can I dislose the company code and other codes like Business area, sales organisation etc of my previous project to the interviewer?
Thanks gurushi,
infact its better you tell how those things have been configured so that they understand how much you know and how the naming conventions were followed.
Everything can be talked as long as its in the premise of professionalism and work.
Thanks
Sadhu Kishore -
Can i install cs 6 on a new powerfull computer ? I have license code and product code
can i install cs 6 on a new powerfull computer ? I have license code and product code. I buy a student & teacher edition up 2013
Sure. It's yours.
Mylenium -
48 Hours ago I started to upgrade to Mountain Lion on a now 10 day old IMac - 30 minutes ago I got the email with the content code and redeem code for the download from the app store - it said download was happening, but nothing happened for 30 min - HOW DO I (or you) FIX IT!?
This is a User's Forum, yelling at us won't help. You have 90 days of customer support via telephone. Use them as they can interact with their system and hopefully get you back on track. Otherwise take it to them at the Genius Bar and have them make it good.
-
Commodity code and import code no
hi SAP SD guys,
can any body explains about commodity codes and import
codes number? for what purpose it is used?when trading internationally, then you need to find the correct commodity code for your goods , so you can fill out the customs paperwork accuratly. the code is minimum 8digit, but can be more. depending on the code you can lookup duty rates and import export restrictions.
commodity code and import code no and HTS harmonized tariff schedule is basically the same and captured in just one single field in SAP. It is used as well for European trade statistics such as Intrastat and extrastat. -
Feching Eccn code and HTS code from GTS to ECC
Hi Gurus,
I am extending a standard delivery idoc (DELVRY05) for some of the header and items fields.
i have tried to pull them throgh the FM /SAPSLL/***_DOCS_SD0C_GET_R3 i have passed the sales order number, item number and VBTYP to this FM to pull the Eccn code and HTS code.but all the tables are containing the zero entries.
Please help me. i have to populate the ECCN code and HTS code at the item level in my EXTENDED (Z)DELVRY05 idoc.
I have the SO number POSNR and material with me in the program.Hi All,
I am now fetching the ECCN code and HTS code as beow:
You need to write an RFC enabled function module in GTS system, and then call this FM from ECC6.0 passing the RFC destination with help of the FM: /SAPSLL/CD_ALE_RECEIVER_GET_R3.
Call the FM as below:
Coding in ECC 6.0.
data: lv_rfc_dest TYPE bdibapi_dest-rfc_dest.
clear : w_so.
w_so-vbeln = w_e1edl24-vgbel." It can be the SO number or the delivery number which will be passed to the RFC ZFM to GTS to fetch the ECCN and HTS code.
append w_so to t_so .
clear: w_so.
CALL FUNCTION '/SAPSLL/CD_ALE_RECEIVER_GET_R3'
IMPORTING
ev_rfc_dest = lv_rfc_dest.
IF lv_rfc_dest IS NOT INITIAL.
CALL FUNCTION 'ZS_HS_ECCN_SCHB_COPY'
DESTINATION lv_rfc_dest
EXPORTING
PRVSY = <fs_lips>-matnr
IMPORTING
ECCN = lv_eccn
HSCODE = lv_stawn
TABLES
REFNO = t_so
EXCEPTIONS
systen_error = 1
connection_failure = 2.
Lv_eccn and Lv_Stawn contains the ECCN and HTS code.
Coding of the ZFM in GTS:
Note: tables parameter of FM RefNo is optional, where as the material number is mandatory parameter for the FM.
FUNCTION ZS_HS_ECCN_SCHB_COPY.
*"*"Local Interface:
*" IMPORTING
*" VALUE(PRVSY) TYPE /SAPSLL/PRVSY
*" EXPORTING
*" VALUE(ECCN) TYPE /SAPSLL/CCNGN
*" VALUE(HSCODE) TYPE /SAPSLL/CCNGN
*" VALUE(SCHB) TYPE /SAPSLL/CCNGN
*" VALUE(RADIO) TYPE /SAPSLL/CCNGN
*" VALUE(RADIO_ECCN) TYPE /SAPSLL/CCNGN
*" VALUE(TEXT) TYPE /SAPSLL/TEXT60
*" TABLES
*" REFNO STRUCTURE /SAPSLL/API6800_DLN_LC_S OPTIONAL
DATA:lv_prtyp TYPE /sapsll/prtyp VALUE '01'.
DATA: lv_rptdt TYPE /sapsll/rptdt.
DATA:lr_datab TYPE /sapsll/rptst_r_t,
lr_datbi TYPE /sapsll/rptet_r_t.
TYPES : BEGIN OF s_pr,
guid_pr TYPE /sapsll/guid_16,
END OF s_pr.
DATA: w_pr TYPE s_pr.
DATA: t_pr TYPE STANDARD TABLE OF s_pr.
TYPES : BEGIN OF s_hscode,
guid_ctsnum TYPE /sapsll/guid_16,
stcts TYPE /sapsll/stcts,
datbi TYPE /sapsll/rptet,
datab TYPE /sapsll/rptst,
END OF s_hscode.
TYPES : BEGIN OF s_corref,
GUID_POBJ TYPE /SAPSLL/CORREF-GUID_POBJ,
REFNO TYPE /SAPSLL/CORREF-REFNO ,
end of s_corref.
TYPES: begin of s_cuit,
GUID_CUHD TYPE /SAPSLL/CUIT-GUID_CUHD,
GUID_PR TYPE /SAPSLL/CUIT-GUID_PR,
CTYDP TYPE /SAPSLL/CUIT-CTYDP,
end of s_cuit.
TYPES : BEGIN OF s_t606g,
LGREG TYPE /SAPSLL/T606G-LGREG,
GGLND TYPE /SAPSLL/T606G-GGLND,
end of s_t606g.
TYPES : BEGIN OF s_TLEGSU ,
LGREG TYPE /SAPSLL/TLEGSU-LGREG ,
CTSEX TYPE /SAPSLL/TLEGSU-CTSEX,
end of s_TLEGSU .
TYPES : BEGIN OF s_ctsnum,
GUID_CTSNUM TYPE /SAPSLL/ctsnum-GUID_CTSNUM ,
STCTS TYPE /SAPSLL/ctsnum-STCTS ,
CCNGN TYPE /SAPSLL/ctsnum-CCNGN ,
END OF s_ctsnum.
DATA: w_hscode TYPE s_hscode.
DATA: t_hscode TYPE STANDARD TABLE OF s_hscode,
t_corref TYPE STANDARD TABLE OF s_corref,
t_cuit TYPE STANDARD TABLE OF s_cuit,
t_t606g TYPE STANDARD TABLE OF s_t606g,
t_tlegsu TYPE STANDARD TABLE OF s_tlegsu,
t_ctsnum TYPE STANDARD TABLE OF s_ctsnum,
w_ctsnum TYPE s_ctsnum,
w_tlegsu TYPE s_tlegsu,
w_cuit TYPE s_cuit,
lv_refno TYPE /sapsll/corref-refno,
t_refno type STANDARD TABLE OF /SAPSLL/API6800_DLN_LC_S,
w_refno TYPE /SAPSLL/API6800_DLN_LC_S.
TYPES : BEGIN OF s_eccn,
ccngn TYPE /sapsll/ccngn,
guid_ctsnum TYPE /sapsll/guid_16,
END OF s_eccn.
DATA: lv_pname TYPE sy-repid,
t_ztuhcd1 type STANDARD TABLE OF ztuhcd1,
w_ztuhcd1 type ztuhcd1.
CONSTANTS: c_eccn TYPE char7 VALUE 'ECCN',
c_HSCODE TYPE char7 value 'HSCODE'.
DATA: w_eccn TYPE s_eccn.
DATA: t_eccn TYPE STANDARD TABLE OF s_eccn.
DATA: w_radio TYPE s_eccn.
DATA: t_radio TYPE STANDARD TABLE OF s_eccn.
DATA:w_text TYPE /sapsll/text60.
REFRESH: t_pr,t_hscode,t_eccn,t_radio,lr_datbi,lr_datab, t_cuit,t_t606g,t_tlegsu,t_ctsnum.
CLEAR: t_pr,t_hscode,t_eccn,w_radio,hscode,eccn,schb,lr_datbi,lr_datab,lv_rptdt,w_ctsnum,w_tlegsu.
GET TIME STAMP FIELD lv_rptdt.
*BREAK-POINT.
CALL FUNCTION '/SAPSLL/VALID_RANGES_PREPARE'
EXPORTING
iv_rptdt = lv_rptdt
iv_option = 'LT'
IMPORTING
er_datab = lr_datab
er_datbi = lr_datbi.
CALL FUNCTION 'CONVERSION_EXIT_SLLPR_INPUT'
EXPORTING
input = prvsy
IMPORTING
output = prvsy.
SELECT guid_pr
INTO TABLE t_pr
FROM /sapsll/pntpr
WHERE grvsy = 'LSG_ECC'
AND prvsy = prvsy
AND prtyp = lv_prtyp.
if refno[] is initial.
IF NOT t_pr[] IS INITIAL.
SELECT guid_ctsnum
stcts
datbi
datab
INTO TABLE t_hscode
FROM /sapsll/prcts
FOR ALL ENTRIES IN t_pr
WHERE guid_pr = t_pr-guid_pr
AND stcts IN ('US_HTS','EARECCN','US_SCHB','NRC_SCHB', 'NRCECCN')
AND datbi IN lr_datbi[]
AND datab IN lr_datab[].
ENDIF.
IF NOT t_hscode[] IS INITIAL.
SELECT ccngn
guid_ctsnum
INTO TABLE t_eccn
FROM /sapsll/ctsnum
FOR ALL ENTRIES IN t_hscode
WHERE guid_ctsnum = t_hscode-guid_ctsnum.
ENDIF.
LOOP AT t_eccn INTO w_eccn.
READ TABLE t_hscode INTO w_hscode WITH KEY guid_ctsnum = w_eccn-guid_ctsnum.
IF sy-subrc = 0.
IF w_hscode-stcts = 'US_HTS'.
hscode = w_eccn-ccngn.
ELSEIF w_hscode-stcts = 'EARECCN'.
eccn = w_eccn-ccngn.
ELSEIF w_hscode-stcts = 'US_SCHB'.
schb = w_eccn-ccngn.
ELSEIF w_hscode-stcts = 'NRC_SCHB'.
radio = w_eccn-ccngn.
ELSEIF w_hscode-stcts = 'NRCECCN'.
radio_eccn = w_eccn-ccngn.
ENDIF.
IF NOT radio IS INITIAL OR
NOT radio_eccn IS INITIAL .
SELECT SINGLE text
INTO w_text
FROM /sapsll/ctsnumt
WHERE guid_ctsnum = w_hscode-guid_ctsnum
AND ctstt = 'F'
AND langu = 'EN'.
IF sy-subrc = 0.
text = w_text.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
Else.
IF NOT t_pr[] IS INITIAL.
SELECT guid_ctsnum
stcts
datbi
datab
INTO TABLE t_hscode
FROM /sapsll/prcts
FOR ALL ENTRIES IN t_pr
WHERE guid_pr = t_pr-guid_pr
AND datbi IN lr_datbi[]
AND datab IN lr_datab[].
endif.
read table refno into w_refno index 1.
if sy-subrc eq 0.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = w_refno-refno
IMPORTING
OUTPUT = lv_refno.
endif.
select GUID_POBJ
REFNO
from /sapsll/corref into TABLE t_corref
where REFNO = lv_REFNO.
if t_corref is not initial.
select GUID_CUHD
GUID_PR
CTYDP
from /sapsll/cuit into table t_cuit
for all entries in t_corref
where GUID_CUHD = t_corref-GUID_POBJ.
endif.
if t_cuit is not initial .
select LGREG GGLND from /SAPSLL/T606G
into table t_T606G
for all entries in t_cuit
where GGLND = t_cuit-CTYDP.
endif.
if t_T606G is not initial.
select LGREG
CTSEX from /SAPSLL/TLEGSU
into TABLE t_TLEGSU
FOR ALL ENTRIES IN t_T606G
where LGREG = t_T606G-LGREG.
endif.
if t_hscode[] is not INITIAL.
select GUID_CTSNUM
STCTS
CCNGN
from /SAPSLL/CTSNUM
into TABLE t_CTSNUM FOR ALL ENTRIES IN t_hscode
where GUID_CTSNUM = t_hscode-GUID_CTSNUM .
endif.
REFRESH: t_ztuhcd1.
CLEAR: t_ztuhcd1,w_ztuhcd1.
* loop at t_TLEGSU into w_TLEGSU.
READ TABLE t_cuit INTO w_cuit index 1.
lv_pname = sy-repid.
* To retrive all the hard coded values
w_ztuhcd1-name = c_eccn.
* w_ztuhcd1-field = c_eccn.
w_ztuhcd1-zkey = w_cuit-ctydp.
APPEND w_ztuhcd1 TO t_ztuhcd1.
CLEAR: w_ztuhcd1,lv_pname.
* To retrive all the hard coded values
CALL FUNCTION 'Z_UHARD_CODE_VALUE'
TABLES
t_ztuhcd1 = t_ztuhcd1
EXCEPTIONS
no_data_found = 1
OTHERS = 2.
if sy-subrc eq 0.
loop at t_ztuhcd1 into w_ztuhcd1 .
read table t_CTSNUM into w_CTSNUM with key STCTS = w_ztuhcd1-low.
if sy-subrc eq 0.
eccn = w_CTSNUM-CCNGN.
endif.
endloop.
endif.
REFRESH: t_ztuhcd1.
CLEAR: t_ztuhcd1,w_ztuhcd1.
* lv_pname = sy-repid.
* To retrive all the hard coded values
w_ztuhcd1-name = c_HSCODE.
* w_ztuhcd1-field = c_HSCODE.
w_ztuhcd1-zkey = w_cuit-ctydp.
APPEND w_ztuhcd1 TO t_ztuhcd1.
CLEAR w_ztuhcd1.
* To retrive all the hard coded values
CALL FUNCTION 'Z_UHARD_CODE_VALUE'
TABLES
t_ztuhcd1 = t_ztuhcd1
EXCEPTIONS
no_data_found = 1
OTHERS = 2.
if sy-subrc eq 0.
loop at t_ztuhcd1 into w_ztuhcd1 .
read table t_CTSNUM into w_CTSNUM with key STCTS = w_ztuhcd1-low.
if sy-subrc eq 0.
HSCODE = w_CTSNUM-CCNGN.
endif.
endloop.
endif.
endif.
ENDFUNCTION. -
Case created without business partner, reason code and result code
In our CRM system, some cases was created without business partner, reason code and result code.
We created some customer functions to make these fields as mandatory, it always work for our technique people and process expert, but it didn't work for some users occasionally. We cannot debug it.
Can anyone tell me why and how to solve it?
Please help me !
Regards,
ShirleyHello Shirley,
Well, then I would check the code, which calls your custom function modules.
It may be possible, that you have an IF in the 'Main' program, which makes it possible to skip the custom FM for these users.
The reason I am assuming this, is that normally you need just to change attributes for a field to make it mandatory, or customizing like SHD0 makes this possible. If you use custom FM, you have to call them somewhere and this is the point I would be looking for.
Check the traces for the users and you should find, that the custom FM are not called for them.
My opinion, of course
Award points if this helps.
Regards,
Martin Kuma -
Hi
Can somebody tell me what is dealer and mother code in SAP. I have an issue wherin the dealer code 514573 is wrong in SAP and the mother code is 3151153.
Issue to be resolved very urgent. Pl help me.
SrikkanthHi Srikanth,
Can you please give explnation on the same mother code and dealer code,How did you resolve the issue
Regards
Narayana -
County Code and City Code in CRM
Hi Guru,
We are having big issue now. Our CRM is fully integrated with ERP, our user want to have the county code and city code in CRM customer master creation. Seems these two fields are not available in CRM, please advice.
Rgs, MichelleHello Michelle,
IN BP Transaction code if you expand the Addess Tab you will find "City/State/ZIP Code"
Here you will get City code.
You can use ZIP Code to map the Country code.
Regards,
Rajendra Sonawane
Maybe you are looking for
-
BAdi / user exit for QN complete (NOCO Status)
Hello QM gurus, I want to make some custom validations on completing of the Quality notification. These changes have to be done for some specific notification types (eg: Q2/F2). The status set on 'Complete' is NOCO. Can anyone please let me know some
-
Photoshop CS2 File Info Templates fill in all pages, not just it's own
I just purchased an Acer Laptop computer, has an AMD 64x2 Dual Core Processor, 2GB of DDR2 Ram, 160GB hard drive with Windows Vista Home Premium preinstalled. I'm not sure how any of this could be of any help, though. I've just installed Photoshop CS
-
Is my iBook REALLY dead?
G4 iBook 1.33 (mid-2005) 12" Suddenly within 2 - 10 minutes of booting perfectly, I'd get the 4-language gray translucent alert telling me to hold down the Power button and shut down. Through testing I determined it was some sort of hardware problem.
-
FB60 Invoice posting system is showing blocked for payment
Dear all, When ever we post FB60 Vendor Invoice document system is showing blocked for payment error. In OBA5 we changed the message warning to Error thats why it is showing error message. In XK01 vendor master we have put it as Payment Block "B". Wh
-
Simple Search (removing funtionality in advanced search)?
Hi, i built a search in a custom BOL using the thmlb:advancedSearch. But i don't want the "advanced" features, like adding more search fields or using greater/lesser/beginns with etc.. Can someone tell me where to find a simpler search implementation