Skip to Content
author's profile photo Former Member
Former Member

Help regarding Rfc_Read_table

Hi All,

Can anybody have the code related to call rfc_read_table bapi from webdynpro. I wrote the code like

try {

Rfc_Read_Table_Input input = new Rfc_Read_Table_Input ();

wdContext.nodeRfc_Read_Table_Input().bind(input);

Rfc_Db_Opt optionValue = new Rfc_Db_Opt ();

input.setQuery_Table("/BIC/AZEMPLOYE00");

optionValue.setText("USERNAME LIKE 'suresh');

wdContext.nodeRfc_Read_Table_Input().bind(input);

input.addOptions(optionValue);

wdContext.currentRfc_Read_Table_InputElement().modelObject().execute();

} catch (WDDynamicRFCExecuteException e) {

// TODO Auto-generated catch block

mgr.reportException("EXception "+e, true);

}

It is giving 0 results.

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 06, 2007 at 09:36 AM

    hi......

    Z_Admin_Schadd_Input obj_add = new Z_Admin_Schadd_Input();

    Zschedule_Table obj_add_table = new Zschedule_Table();

    obj_add_table.setAgency(wdContext.currentContextElement().getCtx_agency());

    obj_add_table.setBatchsize(wdContext.currentContextElement().getCtx_batch_size());

    obj_add_table.setDuration(wdContext.currentContextElement().getCtx_duration());

    Date temp1 =Date.valueOf(wdContext.currentContextElement().getCtx_e_date().toString());

    obj_add_table.setE_Date(temp1);

    obj_add_table.setE_Time(wdContext.currentContextElement().getCtx_e_time());

    obj_add_table.setFactype(wdContext.currentContextElement().getCtx_fac_type());

    obj_add_table.setFaculty(wdContext.currentContextElement().getCtx_faculty());

    obj_add_table.setLoc(wdContext.currentContextElement().getCtx_location());

    Date temp =Date.valueOf(wdContext.currentContextElement().getCtx_s_date().toString());

    obj_add_table.setS_Date(temp);

    obj_add_table.setS_Time(wdContext.currentContextElement().getCtx_s_time());

    obj_add_table.setSeat_Avail(wdContext.currentContextElement().getCtx_seats_aval());

    obj_add_table.setSeat_Res(wdContext.currentContextElement().getCtx_seats_res());

    obj_add_table.setVenue(wdContext.currentContextElement().getCtx_venue());

    short select = 1;

    obj_add.setI_Select(select);

    obj_add.addIt_Adm(obj_add_table);

    wdContext.nodeZ_Admin_Schadd_Input().bind(obj_add);

    try

    {

    wdContext.currentZ_Admin_Schadd_InputElement().modelObject().execute();

    }

    catch (Exception e)

    {

    wdComponentAPI.getMessageManager().reportSuccess(e.getMessage());

    }

    wdContext.nodeOutput().invalidate();

    i hope this code will be help full for u

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 06, 2007 at 09:50 AM

    wdContext.nodeRfc_Read_Table_Input().bind(input);

    input.addOptions(optionValue);

    in above to line......

    first add option value.......i.e.input.addOptions(optionValue);

    then bind....

    ok

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Actauallu when we execute that bapi the table itself is giving as one string and the output is comming as single string with the collection attributes. I can seperate those records onlt with the spaces but for some attributes are having spaces(For ex: the country name "United States"). Is there any other solution to resolve my issue?

  • author's profile photo Former Member
    Former Member
    Posted on Sep 06, 2007 at 11:16 AM

    hi

    only one solution......

    go in bapi and change little programing .......instade of space change to comma(,)

    then it is possible.....

    and even sequense is also important because it is going to use in programing...

    with regards

    jayesh talreja

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 07, 2007 at 03:16 AM

    Problem solved

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi,

      The following code may be used for fetching data from RFC_READ_TABLE.

      IPublic<app>.IRfc_Read_Table_InputNode rfcNode =
      			wdContext.nodeRfc_Read_Table_Input();
      
      		try {
      
      			Rfc_Read_Table_Input input =
      				new Rfc_Read_Table_Input();
      			input.setQuery_Table("<tablename>");
      			input.setDelimiter("|");
      
      			Rfc_Db_Fld fieldValue = new Rfc_Db_Fld();
      			fieldValue.setFieldname("<field1>");
      			input.addFields(fieldValue);
      
      			fieldValue = new Rfc_Db_Fld();
      			fieldValue.setFieldname("<field2>");
      			input.addFields(fieldValue);
      
      			Rfc_Db_Opt optionValue = new Rfc_Db_Opt ();
      			optionValue.setText(" USERNAME LIKE 'abc' ");
      			input.addOptions(optionValue);
      
      			rfcNode.bind(input);
      
      			wdContext
      				.currentRfc_Read_Table_InputElement()
      				.modelObject()
      				.execute();
      			wdContext.nodeOutput().invalidate();
      		} 
      		
      		catch (WDDynamicRFCExecuteException e) {
      			//	   TODO Auto-generated catch block
      			mgr.reportException("EXception " + e, true);
      		}
      
      

      Ashish shah

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.