Advance Grid using Remote Object
Hai All,
Kindly check this code advance grid is not filling.But the datas are coming .Please help me
private function init():void
ProductDataService = new RemoteObject("GenericDestination");
ProductDataService.source = "ClassLibrary1.Class1";
ProductDataService.addEventListener(ResultEvent.RESULT,ProductResultHandler);
ProductDataService.emp();
private function ProductResultHandler(event:ResultEvent):void
catalog = new ArrayCollection(event.result as Array);
myADGEmp.dataProvider=catalog;
<mx:AdvancedDataGrid id="myADGEmp" width="100%" height="100%" color="0x323232" initialize="gcemp.refresh()">
<mx:dataProvider>
<mx:GroupingCollection id="gcemp" source="{catalog}">
<mx:grouping>
<mx:Grouping>
<mx:GroupingField name="dept"/>
</mx:Grouping>
</mx:grouping>
</mx:GroupingCollection>
</mx:dataProvider>
<mx:columns>
<mx:AdvancedDataGridColumn dataField="dept"/>
<mx:AdvancedDataGridColumn dataField="empname"/>
<mx:AdvancedDataGridColumn dataField="price" headerText="Territory Rep"/>
</mx:columns>
</mx:AdvancedDataGrid>
Regards and Thanks,
Arun
Hi,
there is a logical error in your code.
ADG has GroupingCollection as dataProvider, but you've override it then data loaded.
In private function ProductResultHandler(event:ResultEvent):void you shoud only call
gcemp.refresh();
Put the result of this trace to see what's with your data
private function ProductResultHandler(event:ResultEvent):void
catalog = new ArrayCollection(event.result as Array);
trace(catalog.length);
trace(catalog[0]);
myADGEmp.dataProvider=catalog;
Similar Messages
-
Advanced ALV using ABAP objects
Hi All ABAPers,
I have a question in Advanced ALV using ABAP objects.Can we display the output ie., ALV Grid without defining the custom cointainer?ie., just as we do in the classical ALV without defining any screens.Can we do that as a normal executable program ie., without using module pool programming.Please give me a solution.
Thanks & Regards,
Chaitanya.If you want editable grids then the cl_salv_table method won't unfortunately be of use since (currently) there's no editable facility / method.
So if you are using cl_gui_alv_grid here's how to "get round" the problem.
I'm essentially using my own alv class which is a reference to cl_gui_alv_grid but the methodology shown here is quite simple.
What you can do is to create a method which calls a function module for example ZZ_CALL_SCREEN so you only have to code a Screen and a GUI in ONE function module and not in every ALV report.
for example you could create something like this
My version has the option of 2 screens - so when I double click on a cell in one grid I can perform some actions and then display a 2nd grid before returning back to the ist grid.You can easily modify this to suit your applications.
The parameters are fairly self evident from the code. You can just use this as a model for your own applications.
I agree that having to code a separate screen and GUI for OO ALV GRID reports was for some people a "show stopper" in switching from the old SLIS to OO ALV reports.
I Hope if any SAP development guys are reading this PLEASE PROVIDE EDITABLE FUNCTIONALITY IN THE NEW CL_SALV_TABLE class. Thanks in advance.
method display_data.
call function 'ZZ_CALL_SCREEN'
exporting
screen_number = screen_number
program = program
title_text = title_text
i_gridtitle = i_gridtitle
i_zebra = i_zebra
i_edit = i_edit
i_opt = i_opt
i_object = z_object
changing
e_ucomm = e_ucomm
it_fldcat = it_fldcat
gt_outtab = gt_outtab.
e_ucomm = sy-ucomm.
endmethod.
function zz_call_screen .
*"*"Local interface:
*" IMPORTING
*" REFERENCE(SCREEN_NUMBER) TYPE SY-DYNNR
*" REFERENCE(PROGRAM) TYPE SY-REPID
*" REFERENCE(TITLE_TEXT) TYPE CHAR50
*" REFERENCE(I_GRIDTITLE) TYPE LVC_TITLE
*" REFERENCE(I_ZEBRA) TYPE LVC_ZEBRA
*" REFERENCE(I_EDIT) TYPE LVC_EDIT
*" REFERENCE(I_OPT) TYPE LVC_CWO
*" REFERENCE(I_OBJECT) TYPE REF TO ZZHR_ALV_GRID
*" CHANGING
*" REFERENCE(E_UCOMM) TYPE SY-UCOMM
*" REFERENCE(IT_FLDCAT) TYPE LVC_T_FCAT
*" REFERENCE(GT_OUTTAB) TYPE STANDARD TABLE
assign gt_outtab to <dyn_table>.
move title_text to screen_title.
assign i_object to <zogzilla>.
export <dyn_table> to memory id 'dawggs'.
export i_gridtitle to memory id 'i_gridtitle'.
export i_edit to memory id 'i_edit'.
export i_zebra to memory id 'i_zebra'.
export i_opt to memory id 'í_opt'.
export it_fldcat to memory id 'it_fldcat'.
case screen_number.
when '100'.
call screen 100.
when '200'.
call screen 200.
endcase.
endfunction.
process before output.
module status_0100.
process after input.
module user_command_0100.
rocess before output.
module status_0200.
process after input.
module user_command_0200.
* INCLUDE LZHR_MISCO01 *
*& Module STATUS_0100 OUTPUT
* text
module status_0100 output.
import <dyn_table> from memory id 'dawggs'.
import i_gridtitle from memory id 'i_gridtitle'.
import i_edit from memory id 'i_edit'.
import i_opt from memory id 'í_opt'.
import it_fldcat from memory id 'it_fldcat'.
i_object = <zogzilla>.
call method i_object->display_grid
exporting
i_gridtitle = i_gridtitle
i_edit = i_edit
i_zebra = i_zebra
i_opt = i_opt
g_fldcat = it_fldcat
g_outtab = <dyn_table>
changing
it_fldcat = it_fldcat
gt_outtab = <dyn_table>.
set pf-status '001'.
set titlebar '000' with screen_title.
endmodule. " STATUS_0100 OUTPUT
*& Module STATUS_0200 OUTPUT
* text
module status_0200 output.
import <dyn_table> from memory id 'dawggs'.
import i_gridtitle from memory id 'i_gridtitle'.
import i_edit from memory id 'i_edit'.
import i_opt from memory id 'í_opt'.
import it_fldcat from memory id 'it_fldcat'.
i_object = <zogzilla>.
call method i_object->display_grid
exporting
i_gridtitle = i_gridtitle
i_edit = i_edit
i_zebra = i_zebra
i_opt = i_opt
g_fldcat = it_fldcat
g_outtab = <dyn_table>
changing
it_fldcat = it_fldcat
gt_outtab = <dyn_table>.
set pf-status '001'.
set titlebar '000' with screen_title.
endmodule. " STATUS_0200 OUTPUT
* INCLUDE LZHR_MISCI01 *
*& Module USER_COMMAND_0100 INPUT
* text
module user_command_0100 input.
case sy-ucomm.
when 'BACK'.
leave to screen 0.
when 'EXIT'.
leave program.
when 'RETURN'.
leave program.
when others.
endcase.
endmodule. " USER_COMMAND_0100 INPUT
*& Module USER_COMMAND_0200 INPUT
* text
module user_command_0200 input.
case sy-ucomm.
when 'BACK'.
leave to screen 0.
when 'EXIT'.
leave program.
when 'RETURN'.
leave program.
when others.
endcase.
endmodule. " USER_COMMAND_0200 INPUT
Cheers
jimbo -
I can't use remote object in Flex to save an image to the server.
I have a situation where I can't use remote object in Flex to save an image to the server.
Could someone help me with an alterntaive?
private function doSave():void {
var bd:BitmapData = new BitmapData(canvas.width,canvas.height);
var pe:PNGEncoder = new PNGEncoder;
bd.draw(canvas);
var ba:ByteArray = pe.encode(bd);
myService.doUpload(ba,sIP);
<cffunction name="doUpload" displayname="Save Signature" hint="Saves a PNG Signature" access="remote" output="false" returntype="any">
<cfargument name="sigbytes" required="true" type="binary">
<cfargument name="ip_suffix" required="true" type="string">
<cfset myUUID = RandomString('ABCDEFGHIJKLMNOPQRSTUVWXYZ',15)>
<cfset name = expandPath("converted_pngs/signature_#arguments.ip_suffix#_#myUUID#.png")>
<cffile action="write" file="#name#" output="#arguments.sigbytes#" />
<cfset SigFileName = "#arguments.ip_suffix#_#myUUID#">
<cfreturn SigFileName />
</cffunction>Try assigning binary arg to <cfimage/> then save.
-
List header for alv grid using abap objects
Hai all,
I have displayed alv grid in container control using abap objects i.e. using method set_table_for_first_display.
now i need to display list header for this alv grid.
please help me how to create with a sample coding.
Thanks and regards,
Prabu S.Create a splitter using CL_GUI_EASY_SPLITTER_CONTAINER with a top and bottom half. Put the alv grid in the bottom half. Use cl_dd_document (documented in help.sap.com ) to build the header in the top half. Use events on CL_GUI_ALV_GRID to handle the top-of-list printing.
Or, if available, use CL_SALV_TABLE, and read the documentation on that. When I needed a header for my report, that's what I did. There's plenty of good documentation about if you'll search for it.
matt -
Error while using Remote object
Badri can you please put the code that we are using
The remoting-config.xml code is
<?xml version="1.0" encoding="UTF-8"?>
<service id="remoting-service"
class="flex.messaging.services.RemotingService">
<adapters>
<adapter-definition id="java-object"
class="flex.messaging.services.remoting.adapters.JavaAdapter"
default="true"/>
</adapters>
<default-channels>
<channel ref="my-amf"/>
</default-channels>
<destination id="GISDBChart">
<properties>
<source>com.ge.gis.reports.GISDBChart</source>
<scope>application<scope>
</properties>
</destination>
<destination id="GISDBReport">
<properties>
<source>com.ge.gis.reports.GISDBReport</source>
<scope>application<scope>
</properties>
</destination>
</service>
The service-config.xml code is
<?xml version="1.0" encoding="UTF-8"?>
<services-config>
<services>
<service-include file-path="remoting-config.xml" />
</services>
<security>
<login-command
class="flex.messaging.security.TomcatLoginCommand"
server="Tomcat"/>
<security-constraint id="basic-read-access">
<auth-method>Basic</auth-method>
<roles>
<role>guests</role>
<role>accountants</role>
<role>employees</role>
<role>managers</role>
</roles>
</security-constraint>
</security>
<channels>
<channel-definition id="my-amf"
class="mx.messaging.channels.AMFChannel">
<endpoint url="
http://{server.name}:{server.port}/{context.root}/messagebroker/amf"
class="flex.messaging.endpoints.AMFEndpoint"/>
<properties>
<polling-enabled>false</polling-enabled>
</properties>
</channel-definition>
<channel-definition id="my-secure-amf"
class="mx.messaging.channels.SecureAMFChannel">
<endpoint
url="https://{server.name}:{server.port}/{context.root}/messagebroker/amfsecure"
class="flex.messaging.endpoints.SecureAMFEndpoint"/>
<properties>
<!--HTTPS requests on some browsers do not work when
pragma "no-cache" are set-->
<add-no-cache-headers>false</add-no-cache-headers>
</properties>
</channel-definition>
<channel-definition id="my-polling-amf"
class="mx.messaging.channels.AMFChannel">
<endpoint url="
http://{server.name}:{server.port}/{context.root}/messagebroker/amfpolling"
class="flex.messaging.endpoints.AMFEndpoint"/>
<properties>
<polling-enabled>true</polling-enabled>
<polling-interval-seconds>8</polling-interval-seconds>
</properties>
</channel-definition>
</channels>
<logging>
<target class="flex.messaging.log.ConsoleTarget"
level="Error">
<properties>
<prefix>[Flex] </prefix>
<includeDate>false</includeDate>
<includeTime>false</includeTime>
<includeLevel>false</includeLevel>
<includeCategory>false</includeCategory>
</properties>
<filters>
<pattern>Endpoint.*</pattern>
<pattern>Service.*</pattern>
<pattern>Configuration</pattern>
</filters>
</target>
</logging>
<system>
<redeploy>
<enabled>true</enabled>
<watch-interval>20</watch-interval>
<watch-file>{context.root}/WEB-INF/flex/services-config.xml</watch-file>
<touch-file>{context.root}/WEB-INF/web.xml</touch-file>
</redeploy>
</system>
</services-config>
The Error is
getFaultHandler: [FaultEvent fault=[RPC Fault
faultString="Send failed" faultCode="Client.Error.MessageSend"
faultDetail="Channel.Connect.Failed error
NetConnection.Call.Failed: HTTP: Status 503: url: '
http://alpigedv4275.corporate.ge.com/portal/messagebroker/amf'"
messageId="06F0E133-07D6-FBCE-037C-DD26A718AE9D" type="fault"
bubbles=false cancelable=true eventPhase=2]
Please Guide me with this problem.... Its Urgentttttt -
Issue Using Remote Object services
I have three projects 'Main','project 1','project 2'. 'Main'
is a FDS project and the rest are 'basic' projects whose ouput
points to the corresponding folder in 'Main'. This setup exists on
the company development server as well as on my local machine.
Since yesterday I have been facing issues connecting to
JavaObjects from flex on my localhost. I have checked out the
source code from the dev server ,so it's same code on both local
machine and the server. Inspite of that I have been having problems
and getting exceptions.
My question is how does the web-inf or any of its files[maybe
some config.xml file] differ when you are executing the fds project
on your local machine and on the server? Since the java team
changes thing frequently we keep picking up the latest copy of
Web-INF.
Any advise is much appreciated.Thanks.Hello Vikas
The document has to be uploaded to the <b>BDS </b>(Business Document Service).
I will give you an example how I did this:
1. Create business object 'ZREPORT'. " for attaching documents to reports
2. Call transaction <b>OAER </b>(Business Document Service) with the following parameters:
- Class name = 'ZREPORT' (my business object)
- Class type = 'BO' (business object)
- Objekt key = leave empty or enter name of report (if empty, a popup appears)
- Storage system = 'BDS_DB' (seemed a good choice to me)
3. Execute
4. In the BDS choose tabstrip "<b>Create</b>" (lower left part of screen). Right-click on the <i>Word document icon </i>and choose<i> Import File</i> from the context menu.
As soon as you have uploaded your Word document it is visible in your business object (attachment list). When you display the attachment list and right-click on the document you can directly open it in the BDS.
Regards
Uwe -
Daisy-chaining remote object calls
If you want to get data from a series of CFCs using remote
object, and each call depends on data received from the previous
call, you have to daisy-chain the functions making the calls,
otherwise there is no way to guarantee that the data is available
in time (in practice it is never available in time) because the
main thread races on regardless.
Now if you want to refresh parts of the data, or you want to
get a different set of data from one or more of the same CFCs, you
either can use the same functions and set up a different set of
daisy-chains with multiple boolean tests to see which chain of
links should be being followed ( and this ends up something akin to
a four-dimensional Hampton Court maze), or you have to duplicate
the remote calls over and over again in different sets of functions
and resultHandlers. Either way you end up with a horrible mess.
Is there any way to write a class that can suspend the main
thread, pending a remote call listener sending a resume main thread
event.
The other way that would work (though this would not be as
good) is to change addEventListener, so that you can pass arguments
into the resultHandler.
Does anyone have any ideas that could lead to a solution to
this problem? It's giving me gray hair.
Doug"suspend the main thread, pending a remote call.." No. Can't
be done.
..."pass arguments into the resultHandler..." Yes, this is
done using the AsyncToken. (ACT pattern)
The send() methods returns an AsyncToken object. You can use
this dynamic object to add almost anything you want to the token,
including strings, and functions (google the term "closure").
As I am still not comfortable with anonymous functions, I
like to pass strings. I pass an identifier, which I can use in a
switch statement to determine the next step. Sometimes I pass a
"nextStep" string to define finer grain conditionality.
I use a single dataService object and result handler function
for all calls.
Tracy -
Flex/Air and Web Services/Remote Objects
If I'm calling a web service operation, either through the
mx:webservice or mx:remoteobject tags, do I need to configure my
Flex or Air project (I'm using the latest Flex Builder IDE) with
the "use remote object access service" when creating the project?
When do I need to configure services-config.xml or
remoting-config.xml?
Can't I simply call a web service operation by specifying the
endpoint (if using mx:remoteobject) or the wsdl location for the
service and then invoking one of its methods? I'm having a very
difficult time consuming a web service through either method (even
on my own local ColdFusion 8 developer instance) and need some
assistance. I've looked all over the internet for help, but, so
far, without success.
Thanks,
-JoseYou do not need to specify any server to use any of the RPC
protocols.
Have you looked at an example?
You have not said what problems you are having.
Be aware of crossdomain security issues.
Tracy -
Remote Objects do not support Java Integers
Another got-cha with using flex ... this is getting pretty
bad .. :(
Integers do not cross over from Java to ActionScript3, using
remote objects. Strings work out great, everything else do not.
Where do I report this bug?After further research, it turns out that flex 3 is still in
the ALPHA stage and is not ready for general release. You simply
cannot get repeatable results when using Flex / Java / JBoss /
BlazeDS in any shape or form with no code change.
Flex just quits, no errors, no nothing. 10% it actually does
it's job (return remote objects), the rest of the time, it does
not, it returns empty objects.
Would be great if this was tested before release. -
When using Remote Objects, I'm successfully using AMF to
transfer PHP Objects.
I have an ArrayCollection that forces the
"com.gh.vo.ContactMainViewVO" type - Works great.
My problem is when I try go another level deeper and type an
array inside of that object, it only types it as an object and not
the [ArrayElementType("com.gh.vo.ContactPhoneNumber")].
Is it possible to do this?
[Bindable]
[ArrayElementType("com.gh.vo.ContactMainViewVO")]
private var _contactsMainView:ArrayCollection;
package com.gh.vo {
import com.gh.vo.*;
import flash.net.registerClassAlias;
import mx.collections.ArrayCollection;
[RemoteClass(alias="ContactMainViewVO")]
[Bindable]
public class ContactMainViewVO {
public var contactId:int;
public var firstName:String;
public var lastName:String;
public var title:String;
public var companyName:String;
public var emailAddress:String;
[ArrayElementType("com.gh.vo.ContactPhoneNumber")]
public var phoneNumbers:Array;
package com.gh.vo {
import com.gh.vo.*;
import flash.net.registerClassAlias;
[RemoteClass(alias="ContactPhoneNumberVO")]
[Bindable]
public class ContactPhoneNumberVO {
public var contactPhoneNubmerId:int;
public var contactId:int;
public var phoneNumer:String;
public var phoneNumberType:String;
public var primaryNumber:int;UPDATE:
I've worked around the problem by using the following (after
correcting some spelling errors *nubmer):
[ArrayElementType("com.gh.vo.ContactPhoneNumber")]
public var phoneNumbers:Array;
[ArrayElementType("com.gh.vo.ContactPhoneNumber")]
private var _phoneNumbers:ArrayCollection;
public function get phoneNumbers():ArrayCollection {
return _phoneNumbers;
public function set phoneNumbers( phoneNumbers:* ):void {
var ac:ArrayCollection = new ArrayCollection();
for each( var pNum:ContactPhoneNumberVO in phoneNumbers ) {
ac.addItem( pNum );
_phoneNumbers = ac;
------------------------------------------------------------ -
Custom Http header in remote object
Hi, how to set custom http header in http request while using remote object in flex?
Thank You, Patrick.
You are best :)
I read this APEX_WEB_SERVICE documentation before,
but after I read once more time
I found most important words "global variable g_request_headers".
I think these variables must be described more in documentation.
On APEX I did:
1) Create New Page -> Form -> Form and Report On Webservice Results.
2) Set all webservice paramters in page wizard.
3) And create a new page process after submit:
Begin
apex_web_service.g_request_headers(1).name := 'username';
apex_web_service.g_request_headers(1).value := ' ... ';
apex_web_service.g_request_headers(2).name := 'password';
apex_web_service.g_request_headers(2).value := ' ... ';
End;
4) It's most important that this process must be done before the webservice process.
Good luck -
Sample Example on Remote Object
Hi All,
I am doing a sample program in Flex using Remote Object, when
i enter Data in TextInput and click getData(button) in the TextArea
conrol the the Data in TextInput should be displayed along with
that some updation, these updations are declared
in the Java. when i click on the Button(getData) it will
update the Data using the RemoteObject. Here is my Application..
Also described the desired path in RemoteConfig.xml
Text.mxml
<?xml version="1.0"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml">
<mx:RemoteObject id="srv" destination="testsession"
fault="faultHandler(event)" >
<mx:method name="getMessage" result="display(event)"
></mx:method>
</mx:RemoteObject>
<mx:Script>
<![CDATA[
import flash.net.navigateToURL;
import mx.rpc.events.ResultEvent;
import mx.controls.Alert;
import mx.rpc.events.ResultEvent;
import mx.rpc.events.FaultEvent;
public function getMessage():void {
Alert.show("alertin echo"+ input.text);
srv.echoMessage(input.text);
public function display(event:ResultEvent):void {
Alert.show("In display Response");
output.text = event.result();
private function faultHandler(event:FaultEvent):void
Alert.show("Server Message: Error"+event.message);
} ]]>
</mx:Script>
<mx:Panel title="Sample" width="320">
<mx:Form width="500">
<mx:FormItem label="Input Message"> <mx:TextInput
id="input"/> </mx:FormItem>
<mx:FormItem> <mx:Button label="Get Message"
click="getMessage()"/> </mx:FormItem>
<mx:FormItem label="Output Message">
<mx:TextArea id="output" show="getMessage()"/>
</mx:FormItem>
</mx:Form>
</mx:Panel>
</mx:Application>
Here is My Java Application
EchoService.java:
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
public class EchoService
public String echo( String inputMessage ) throws Exception
StringBuffer result = new StringBuffer();
result.append("EchoService received ");
result.append(inputMessage);
result.append(" at ");
result.append(dateFormat.format(new Date()));
return result.toString();
private DateFormat dateFormat = new
SimpleDateFormat("HH:mm:ss");
when i run these am getting an Error at ServerMessage as:
ERROR:
Server Message: Error(mx.messaging.messages::ErrorMessage)#0
body = (Object)#1
clientId = (null)
correlationId = "F3C89B4B-8166-32AA-7C80-5F0CE42EFB40"
destination = ""
extendedData = (null)
faultCode = "Client.Error.MessageSend"
faultDetail = "Channel.Connect.Failed error
NetConnection.Call.Failed: HTTP: Status 500: url: '
http://localhost:8600/messagebroker/amf'"
faultString = "Send failed"
headers = (Object)#2
messageId = "443DBB42-8B18-84D8-151F-5F0CED757E35"
rootCause = (Object)#3
code = "NetConnection.Call.Failed"
description = "HTTP: Status 500"
details = "
http://localhost:8600/messagebroker/amf"
level = "error"
timestamp = 0
timeToLive = 0
can anyone help me how to achieve this.
Thanks,
Raa
Text
ERRORJames,
Go through the blogs and articles in this thread.
Re: Integrating SSO with Yahoo
Hope this helps.
Cheers,
Sandeep Tudumu -
Can't load all properties of a remote object
Hi,
I have a java class called
Employe which has a field of type
Group(an java class)
when i get the Employe Object in flex using remote Object and
try to access Group's properties like
employe.goup.name, i get:
"Error #1009: Cannot access a property or method of a null
object reference".
Can some one please help me! Thank you.Please check your Node Object, I mean all Objects that you are going to save is serialized or not.
-
Do I have to use lookup() to get a reference of remote object?
Hello,
I appreciate the help from you guys in advance. My question is, do I have to use lookup() to get the reference to a remote object? Right now I want to pass the remote object itself which can be serialized via stream. I am not sure if this way works.
Cheers!
Stevesome part code:
client:
lookup=UC_LookUp.StkTakeListingHdrLookup().getStkTake(usrInfo,tfStkTakeListNo.getText());
UC_LookUp
public static basewms.uc.interfaces.UC_ISCSStkTakeListingHdr_Remote StkTakeListingHdrLookup()
if (look_up==null) look_up= new UC_LookUp();
if(stktakelistinghdr == null)
stktakelistinghdr = look_up.startLookUp("UCStkTakeListingHdr","192.168.10.98", 7000);
while (stktakelistinghdr==null)
try { Thread.sleep(1000); }catch(InterruptedException e) {}
return (basewms.uc.interfaces.UC_ISCSStkTakeListingHdr_Remote)look_up.getRemote(stktakelistinghdr); -
ALV report for 5 Grids using Objects and Method
I have few questions in ALV 5Grids ,could you please correct me in the following program logic...
Using this program logic i am able to generate the five Grids and able to populate Header details from VBAK into Grid1,If you click in the Grid 1 and it is populating item details in Grid2 from VBAP,parallally populating the customer data in Grid5 from KNA1.
Now the pending issue is ,
if you click in the Grid2 then we should populate the shipping details in Grid3 and
if you click in the Grid3 then we should populate the billing details in Grid4.
Program Logic;
REPORT ZAREPAS20.
Tables : vbak,vbap,likp,lips,vbrk,vbrp,kna1.
DATA : OK_CODE LIKE SY-UCOMM,
G_CONTAINER TYPE SCRFNAME VALUE 'BCALV7_GRID_DEMO_0100_VASU',
DOCKING TYPE REF TO CL_GUI_DOCKING_CONTAINER,
SPLITTER_1 TYPE REF TO CL_GUI_SPLITTER_CONTAINER,
SPLITTER_2 TYPE REF TO CL_GUI_SPLITTER_CONTAINER,
splitter_3 TYPE REF TO CL_GUI_SPLITTER_CONTAINER,
CELL_TOP1 TYPE REF TO CL_GUI_CONTAINER,
CELL_BOTTOM1 TYPE REF TO CL_GUI_CONTAINER,
CELL_TOP2 TYPE REF TO CL_GUI_CONTAINER,
CELL_BOTTOM2 TYPE REF TO CL_GUI_CONTAINER,
CELL_LEFT TYPE REF TO CL_GUI_CONTAINER,
CELL_middle TYPE REF TO CL_GUI_CONTAINER,
CELL_RIGHT TYPE REF TO CL_GUI_CONTAINER,
GRID1 TYPE REF TO CL_GUI_ALV_GRID,
GRID2 TYPE REF TO CL_GUI_ALV_GRID,
GRID3 TYPE REF TO CL_GUI_ALV_GRID,
GRID4 TYPE REF TO CL_GUI_ALV_GRID,
GRID5 TYPE REF TO CL_GUI_ALV_GRID.
DATA : GT_VBAK TYPE STANDARD TABLE OF VBAK,
GT_VBAP TYPE STANDARD TABLE OF VBAP,
GT_LIKP TYPE STANDARD TABLE OF likp,
GT_LIPS TYPE STANDARD TABLE OF lips,
GT_VBRK TYPE STANDARD TABLE OF vbrk,
GT_VBRP TYPE STANDARD TABLE OF vbrp,
GT_KNA1 TYPE STANDARD TABLE OF kna1.
DATA:begin of itab1 occurs 0,
vbeln type likp-VBELN,
erzet type likp-ERZET,
lfart type likp-LFART,
posnr type lips-POSNR,
END OF ITAB1.
DATA:begin of itab2 occurs 0,
vbeln like vbrk-vbeln,
posnr like vbrk-fktyp,
fkart like vbrk-fkart,
fklmg like vbrp-fklmg,
end of itab2.
*selection screen for selecting range of values
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE text-001.
select-options: S_vbeln for VBAK-vbeln.
selection-screen end of block b1.
CLASS lcl_eventhandler DEFINITION
CLASS lcl_eventhandler DEFINITION.
PUBLIC SECTION.
CLASS-METHODS:
handle_double_click FOR EVENT double_click OF cl_gui_alv_grid
IMPORTING
e_row
e_column
es_row_no
sender. " sending control, i.e. ALV grid that raised event
ENDCLASS. "lcl_eventhandler DEFINITION
CLASS lcl_eventhandler IMPLEMENTATION
CLASS lcl_eventhandler IMPLEMENTATION.
METHOD HANDLE_DOUBLE_CLICK.
*DEFINE LOCAL DATA.
DATA : itab_vbak type VBAK,
itab_vbap type VBAP,
itab_likp type likp,
itab_lips type lips,
itab_vbrk type vbrk,
itab_vbrp type vbrp,
itab_kna1 type kna1.
*DISTINGUISH ACCORDING TO SENDING GRID INSTANCE
CASE SENDER.
WHEN GRID1.
READ TABLE gt_VBAK INTO itab_vbak INDEX e_row-index.
CHECK ( itab_vbak-vbeln IS NOT INITIAL ).
CALL METHOD GRID1->set_current_cell_via_id
EXPORTING
is_ROW_ID =
is_COLUMN_ID =
is_row_no = es_row_no.
Triggers PAI of the dynpro with the specified ok-code
CALL METHOD cl_gui_cfw=>set_new_ok_code( 'ORDER_DETAILS' ).
WHEN GRID2.
READ TABLE gt_VBAP INTO itab_vbap INDEX e_row-index.
CHECK ( itab_vbap-vbeln IS NOT INITIAL ).
CALL METHOD GRID2->set_current_cell_via_id
EXPORTING
is_ROW_ID =
is_COLUMN_ID =
is_row_no = es_row_no.
Triggers PAI of the dynpro with the specified ok-code
CALL METHOD cl_gui_cfw=>set_new_ok_code( 'ORDER_DETAILS' ).
WHEN GRID3.
READ TABLE gt_LIPS INTO itab_LIPS INDEX e_row-index.
CHECK ( itab_lips-vgbel IS NOT INITIAL ).
CALL METHOD GRID3->set_current_cell_via_id
EXPORTING
is_ROW_ID =
is_COLUMN_ID =
is_row_no = es_row_no.
Triggers PAI of the dynpro with the specified ok-code
CALL METHOD cl_gui_cfw=>set_new_ok_code( 'DELIVERY_DETAILS' ).
WHEN GRID4.
READ TABLE gt_VBRP INTO itab_VBRP INDEX e_row-index.
CHECK ( itab_vbrp-vgbel IS NOT INITIAL ).
CALL METHOD GRID4->set_current_cell_via_id
EXPORTING
is_ROW_ID =
is_COLUMN_ID =
is_row_no = es_row_no.
Triggers PAI of the dynpro with the specified ok-code
CALL METHOD cl_gui_cfw=>set_new_ok_code( 'BILLING_DETAILS' ).
WHEN GRID5.
READ TABLE gt_KNA1 INTO itab_KNA1 INDEX e_row-index.
CHECK ( itab_kna1-kunnr IS NOT INITIAL ).
SET PARAMETER ID 'KUN' FIELD itab_KNA1-KUNNR.
CALL TRANSACTION 'MM02' AND SKIP FIRST SCREEN.
WHEN OTHERS.
RETURN.
ENDCASE.
endmethod.
endclass. "lcl_eventhandler IMPLEMENTATION
start-of-selection.
*write :/ 'FEDEX INT''''L' .
SELECT * FROM vbak INTO TABLE gt_VBAK
where vbeln IN S_VBELN.
creating docking container
create object docking
exporting
parent = cl_gui_container=>screen0
ratio = 90
exceptions
others = 6.
if sy-subrc eq 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Create splitter container
CREATE OBJECT splitter_1
EXPORTING
parent = docking
rows = 1
columns = 3
NO_AUTODEF_PROGID_DYNNR =
NAME =
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
OTHERS = 3.
IF sy-subrc eq 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Get cell container
CALL METHOD splitter_1->get_container
EXPORTING
row = 1
column = 1
RECEIVING
container = cell_left.
CALL METHOD splitter_1->get_container
EXPORTING
row = 1
column = 2
RECEIVING
container = cell_middle.
CALL METHOD splitter_1->get_container
EXPORTING
row = 1
column = 3
RECEIVING
container = cell_right.
Create 2nd splitter container
CREATE OBJECT splitter_2
EXPORTING
parent = cell_left
rows = 2
columns = 1
NO_AUTODEF_PROGID_DYNNR =
NAME =
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
OTHERS = 3.
IF sy-subrc eq 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Get cell container
CALL METHOD splitter_2->get_container
EXPORTING
row = 1
column = 1
RECEIVING
container = cell_top1.
CALL METHOD splitter_2->get_container
EXPORTING
row = 2
column = 1
RECEIVING
container = cell_bottom1.
Create 3rd splitter container
CREATE OBJECT splitter_3
EXPORTING
parent = cell_middle
rows = 2
columns = 1
NO_AUTODEF_PROGID_DYNNR =
NAME =
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
OTHERS = 3.
IF sy-subrc eq 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Get cell container
CALL METHOD splitter_3->get_container
EXPORTING
row = 1
column = 1
RECEIVING
container = cell_top2.
CALL METHOD splitter_3->get_container
EXPORTING
row = 2
column = 1
RECEIVING
container = cell_bottom2.
Create ALV grids
CREATE OBJECT grid1
EXPORTING
i_parent = cell_top1
EXCEPTIONS
OTHERS = 5.
IF sy-subrc eq 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CREATE OBJECT grid2
EXPORTING
i_parent = cell_bottom1
EXCEPTIONS
OTHERS = 5.
IF sy-subrc eq 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CREATE OBJECT grid3
EXPORTING
i_parent = cell_top2
EXCEPTIONS
OTHERS = 5.
IF sy-subrc eq 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CREATE OBJECT grid4
EXPORTING
i_parent = cell_bottom2
EXCEPTIONS
OTHERS = 5.
IF sy-subrc eq 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CREATE OBJECT grid5
EXPORTING
i_parent = cell_right
EXCEPTIONS
OTHERS = 5.
IF sy-subrc eq 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Set event handler
SET HANDLER: lcl_eventhandler=>handle_double_click FOR grid1.
SET HANDLER: lcl_eventhandler=>handle_double_click FOR grid2.
SET HANDLER: lcl_eventhandler=>handle_double_click FOR grid3.
SET HANDLER: lcl_eventhandler=>handle_double_click FOR grid4.
SET HANDLER: lcl_eventhandler=>handle_double_click FOR grid5.
Display data
CALL METHOD grid1->set_table_for_first_display
EXPORTING
i_structure_name = 'VBAK'
CHANGING
it_outtab = gt_VBAK
EXCEPTIONS
OTHERS = 4.
IF sy-subrc eq 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
REFRESH: gt_vbap.
CALL METHOD grid2->set_table_for_first_display
EXPORTING
i_structure_name = 'VBAP'
CHANGING
it_outtab = gt_VBAP " empty !!!
EXCEPTIONS
OTHERS = 4.
IF sy-subrc eq 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
REFRESH: gt_LIPS.
CALL METHOD grid3->set_table_for_first_display
EXPORTING
i_structure_name = 'LIPS'
CHANGING
it_outtab = gt_LIPS " empty !!!
EXCEPTIONS
OTHERS = 4.
IF sy-subrc eq 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
REFRESH: gt_VBRP.
CALL METHOD grid4->set_table_for_first_display
EXPORTING
i_structure_name = 'VBRP'
CHANGING
it_outtab = gt_VBRP " empty !!!
EXCEPTIONS
OTHERS = 4.
IF sy-subrc eq 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
REFRESH: gt_KNA1.
CALL METHOD grid5->set_table_for_first_display
EXPORTING
i_structure_name = 'KNA1'
CHANGING
it_outtab = gt_KNA1 " empty !!!
EXCEPTIONS
OTHERS = 4.
IF sy-subrc eq 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Link the docking container to the target dynpro
CALL METHOD docking->link
EXPORTING
repid = syst-repid
dynnr = '0100'
CONTAINER =
EXCEPTIONS
OTHERS = 4.
IF sy-subrc eq 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
NOTE: dynpro does not contain any elements (ok_code -> GD_OKCODE)
CALL SCREEN '0100'.
Flow logic of dynpro:
*PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
*PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.
end-of-selection.
*& Module STATUS_0100 OUTPUT
text
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'STATUS_0100'.
SET TITLEBAR 'xxx'.
Refresh display of detail ALV list
CALL METHOD grid2->refresh_table_display
EXPORTING
IS_STABLE =
I_SOFT_REFRESH =
EXCEPTIONS
OTHERS = 2.
IF sy-subrc eq 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Refresh display of detail ALV list
CALL METHOD grid3->refresh_table_display
EXPORTING
IS_STABLE =
I_SOFT_REFRESH =
EXCEPTIONS
OTHERS = 2.
IF sy-subrc eq 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Refresh display of detail ALV list
CALL METHOD grid4->refresh_table_display
EXPORTING
IS_STABLE =
I_SOFT_REFRESH =
EXCEPTIONS
OTHERS = 2.
IF sy-subrc eq 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Refresh display of detail ALV list
CALL METHOD grid5->refresh_table_display
EXPORTING
IS_STABLE =
I_SOFT_REFRESH =
EXCEPTIONS
OTHERS = 2.
IF sy-subrc eq 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
text
MODULE USER_COMMAND_0100 INPUT.
CASE SY-UCOMM.
WHEN 'BACK' OR
'EXIT' OR
'CANCEL'.
SET SCREEN 0.LEAVE SCREEN.
USER HAS PUSHED BUTTON "DISPLAY OREDERS"
WHEN 'ORDER_DETAILS'.
PERFORM ORDER_SHOW_DETAILS.
when 'DELIVERY_DETAILS'.
PERFORM DELIVERY_SHOW_DETAILS.
WHEN 'BILLING_DETAILS'.
PERFORM BILLING_SHOW_DETAILS.
WHEN OTHERS.
ENDCASE.
CLEAR : OK_CODE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form ORDER_SHOW_DETAILS
text
--> p1 text
<-- p2 text
FORM order_show_details .
define local data
DATA:
ld_row TYPE i,
itab_VBAK TYPE VBAK.
CALL METHOD grid1->get_current_cell
IMPORTING
e_row = ld_row.
READ TABLE gt_VBAK INTO itab_VBAK INDEX ld_row.
CHECK ( syst-subrc = 0 ).
SELECT * FROM KNA1 INTO TABLE gt_KNA1
WHERE KUNNR = itab_VBAK-KUNNR.
SELECT * FROM VBAP INTO TABLE gt_VBAP
WHERE VBELN = ITAB_VBAK-VBELN.
*REFRESH: gt_LIPS.
ENDFORM. " ORDER_SHOW_DETAILS
*& Form DELIVERY_SHOW_DETAILS
text
--> p1 text
<-- p2 text
FORM DELIVERY_SHOW_DETAILS .
define local data
DATA:
ld_row TYPE i,
itab_VBAP TYPE VBAP.
CALL METHOD grid1->get_current_cell
IMPORTING
e_row = ld_row.
READ TABLE gt_VBAP INTO itab_VBAP INDEX ld_row.
CHECK ( syst-subrc = 0 ).
SELECT LIKPVBELN LIKPERZET LIKPLFART LIPSVBELN
INTO CORRESPONDING FIELDS OF TABLE ITAB1
FROM ( LIKP INNER JOIN LIPS ON LIKPVBELN = LIPSVBELN )
WHERE LIKP~VBELN IN S_VBELN.
*REFRESH: gt_LIPS.
ENDFORM. " DELIVERY_SHOW_DETAILS
*& Form BILLING_SHOW_DETAILS
text
--> p1 text
<-- p2 text
FORM BILLING_SHOW_DETAILS .
define local data
DATA:
ld_row TYPE i,
itab_LIPS TYPE LIPS.
CALL METHOD grid1->get_current_cell
IMPORTING
e_row = ld_row.
READ TABLE gt_LIPS INTO itab_LIPS INDEX ld_row.
CHECK ( syst-subrc = 0 ).
SELECT VBRKVBELN VBRKFKTYP VBRKFKART VBRPFKLMG
INTO CORRESPONDING FIELDS OF TABLE ITAB2
FROM ( VBRK INNER JOIN VBRP ON VBRKVBELN = VBRPVBELN )
WHERE VBRK~VBELN IN S_VBELN.
ENDFORM. " BILLING_SHOW_DETAILSHi,
ALV means ABAP List Viewer. Most convenient way to use it is through reuse library (cf.
transaction se83) available from release 4.6 of SAP R/3.
ALV is available in two modes: list and grid. List mode is good old list processing with
standard functionnalities, and grid mode is using a new OCX object displaying grids.
Classical reports needs more coding to set the horizontal and vertical lines.we need to adjust
the lines manually.Even interactive also takes lot of code.
ALV reports reduces the code when compared to classical reports.we use function modules to
generate the output.
that r REUSE_ALV_LIST_DISPLAY,REUSE_ALV_GRID_DISPLAY,REUSE_ALV_HIERSEQ_LIST_DISPLAY etc..
the following threads will give some examples of the functions which you are expecting
Header
regarding function module
hide ALV field
Simply Display selection parameter values in the ALV OUTPUT
Drag and drop in a report
https://www.sdn.sap
Reprots
http://www.sapgenie.com/abap/reports.htm
http://www.allsaplinks.com/material.html
http://www.sapdevelopment.co.uk/reporting/reportinghome.htm
ALV
1. Please give me general info on ALV.
http://www.sapfans.com/forums/viewtopic.php?t=58286
http://www.sapfans.com/forums/viewtopic.php?t=76490
http://www.sapfans.com/forums/viewtopic.php?t=20591
http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you
use - ABAP Objects calls or simple function modules.
Maybe you are looking for
-
Read and Write data in iphone app
I want to build a simple offline mobile app which reads and writes or stores info to a file, xml, json, txt or whatever. What is the best way to do this? I am currently learing jQuery and PHP, so I don't want to have to learn some other million thing
-
Hello, I have a photoshop file with 72 dpi, 800 x 600 pixels (basic wallpaper design). I'm importing an image that is 1200 x 700 pixels, stock image purchased from iStock. I double checked the image in Windows picture preview software, and it says it
-
Customer Invoice Type Determination
Hi SCN, I'm an ABAP developer and I'm currently developing some SD forms. I want to store in the SAP system how the customer wants to receive his invoice (by mail or as a print-out). Is there a standard way of holding this information? Thanks in adva
-
I currently have an iMac with the following configuration: OS X (10.6.3) 444GB available on my hard drive ATI Radeon HD 4850 graphics card (512 MB VRAM) Intel Core Duo processor at 2.93GHz 4GB of memory Bus speed of 1.07GHz Will it support Final Cut
-
Two delivery order not invoice to single sales order
Hi Experts, in our user create one sale order invoice pcking with two delivery with one shipment.if one delivery is picked.other delivery picked with same sale order invoice .it will be overwrited.Then how to solve the two delivery