SAPAG2001BusinessServerPagesDevelopmentofWebApplicationswiththeSAPWebApplicationServer6.20SAPAG2001TopicBusinessServerPagesUserInteractionStateinWebApplicationsDatabaseAccessBSPExtensionsModelViewControllerSAPAG2001InternetCommunicationFramework(ICF)ServermethodIF_HTTP_EXTENSION~HANDLE_REQUEST.data:datatypestring.*createsomeresponsedataserver-response-set_header_field(name='Content-Type'value='text/html').server-response-set_header_field(name='Expires'value='0').concatenate'html''body''Serversuccessfullyreached.''/body''/html'intodata.server-response-set_cdata(data=data).endmethod.HTTPRequestICFHTTPExtObjectCallmethodhandle_requestResponseLowLevelHTTPCommunicationABAPObjectsclasses,whichimplementIF_HTTP_EXTENSIONinterfaceObjectsSERVER,REQUESTandRESPONSEdirectlyavailableassigningURLtoHTTP-extensioninTASICFHTTPserverandclientfunctionalitySAPAG2001AttributesBSPApplicationStructureApplicationClassMethodsBSPApplicationBSPApplication•BusinessServerPageswhichdefinetheWebUIandcontainserversidescripting•Arbitraryadditionalfiles(Images,backgroundpics,buttonGIFs,...),Style-Sheets,etc.•Applicationclass,thatcontainstheapplicationlogic•AccessesbackendfunctionalitySeparationofpresentationandbusinesslogicBSPPageBSPBSPBSPPagehtml...%loopatitab....%AttributesBusinessObjectClassMethodsAttributesBusinessObjectClassMethodsAttributesBusinessObjectClassMethodsSAPAG2001BusinessServerPages-HelloWorldasimpleBSPpagethat...showsserversidescriptingwithABAPorJavaScriptcontainsstaticHTML(orXML,or...)partsmixedwithserversidescriptingissimilartoActiveServerPages(Microsoft)orJavaServerPagesisaccessibleviaURLlikecommonpagesofawebserver%@pagelanguage=abap%htmlbodycenter%do5times.%fontsize=%=sy-index%HelloWorld!br/font%enddo.%/center/body/htmlLayout%@pagelanguage=javascript%htmlbodycenter%for(i=0;i5;i++){%fontsize=%=i%HelloWorld!br/font%}%/center/body/htmlLayoutSAPAG2001ICFServicesTransactionSICFservicesdefinesURLforHTTPhandlersDefaultusersettingsforpublicsitesDefaultclient,languagedefinitionofAliasesIndividualICFServicesforBSPApplicationsSAPAG2001TopicBusinessServerPagesUserInteractionStateinWebApplicationsDatabaseAccessBSPExtensionsModelViewControllerSAPAG2001BSP–InitializationandLayoutselect*fromsflightintotableflights.InitializationLayoutTheLayoutpartcontainsscriptcodemixedwithstaticformattingdirectives(e.g.HTML).ThedatasourcesdeclaredaspageattributesaredirectlyaccessibleintheInitializationandLayoutstep.BusinessServerPageAttributeTyp.Ass.TypeFLIGHTSTYPEFLIGHTTABPageAttributes%@pagelanguage=abap%htmlbodytableborder=1trthCarrier/ththConnection/ththDate/th/tr%data:walikelineofflights.loopatflightsintowa.%trtd%=wa-carrid%/tdtd%=wa-connid%/tdtd%=wa-fldate%/td/tr%endloop.%/table/body/htmlEverypagehasadefinedstepfordataretrievalthatisusedintheLayoutstep.SAPAG2001EventHandlerEventsthatarecalledduringtheprocessingoftherequestofthepageOnInitializationcalledbeforethepageisrenderedfordataretrievelOnInputProcessinghandlingoftheuserinputOnCreateatfirstcreationofthepage...SAPAG2001PageAttributesObjectsthatareaccessibleinallpageeventsandtheLayoutsectionexample:tablesthatarefilledintheInitializationstepandusedintheLayoutstepSAPAG2001ApplicationClassAttributesApplicationClassMethodsBSPApplicationBSPPageBSPBSPBSPPagehtml...%application-...%AnInstanceoftheApplicationClassiscreatedateveryRequesttothepage(stateless)andisavailableinalleventsandintheLayoutSAPAG2001TopicBusinessServerPagesUserInteractionStateinWebApplicationsDatabaseAccessBSPExtensionsModelViewControllerSAPAG2001HTMLFormsUsedforuserInputtextslistboxescheckboxesfileupload...InputistransferredviaGETorPOSTrequesttotheserveraspartoftheURLaspartoftherequestbodyformaction=/cgi-bin/proc.plmethod=getyourNickname:inputtype=textname=nicknameinputtype=submitname=Submit/formformmethod=getinputtype=checkboxname=selvalue=appleAppleinputtype=checkboxname=selvalue=orangeOrangeinputtype=checkboxname=selvalue=cherryCherryinputtype=submitname=Submit/formformaction=/cgi-bin/procxls.plmethod=postUploadTextFile:inputtype=filename=dataaccept=*/textinputtype=submitvalue=Upload/formformaction=output.htmmethod=postselectname=sel_categoryoptionvalue=appleApplesoptionvalue=orangeOranges/selectinputtype=textname=searchvalue=inputtype=submitvalue=Select/formSAPAG2001FlowwithinsimpleBSPpagesInitializationDataretrievaldependingoninputparametersLayoutrenderingofthepageprocessingthescriptingcodeInitializationDataretrievaldependingoninputparametersLayoutrenderingofthepageprocessingthescriptingcodeBSPRuntimeResponseHTTPPOSTHTTPGETInitializationDataretrievaldependingoninputparametersLayoutrenderingofthepageprocessingthescriptingcodeUserentersdataandclicksabuttonselect*from...intotableit.callfunction...HTMLBODY%do...enddo.%bsp:button...formResponseRuntimedeterminesBSPAppandPageThatPOSTrequestse.g.anotherpageFirstPag