cancel
Showing results for 
Search instead for 
Did you mean: 

Passing data from webdynpro table to ARFC2

Former Member
0 Kudos

Hi Friends

I using NWDS7.2 and call ARFC2 is zppf2001. ( not using ARFC1 )

I need to pass the the data from the input table of the webdynpro to IMPORT parameter of the RFC.

This ARFC2 Table is ITAB. ( ITAB-MATNR, ITAB-WERKS ).

I want input 2 Matnr "100-100"、"100-120" and Werks "1000" "1200"

Can any body seuggest/send me the code??

public void wdDoInit()

{

//@@begin wdDoInit()

zppf2001RFC1Model = new Zppf2001RFC1Model();

zppf2001 = new Zppf2001_Input(zppf2001RFC1Model);

wdContext.nodeZppf2001_Input().bind(zppf2001);

//@@end

}

//@@begin call_ZPPF2001()

try {

this.zppf2001.execute();

}

catch(ARFC2ModelExecuteException ex) {

msgMgr.reportException(ex.getNestedLocalizedMessage());

ogger.catching(ex);

}

//@@end

//@@begin others

Zppf2001RFC1Model zppf2001RFC1Model;

Zppf2001_Input zppf2001;

//@@end

Accepted Solutions (1)

Accepted Solutions (1)

former_member214651
Active Contributor
0 Kudos

Hi,

Try with the following code for ARFC2 model:

	
//This code will be generated when u apply template for service controller
FlightModel flightModelModel = createAndMapModelInstance("<model package>");
Bapi_Flight_Getlist_Input bapi_Flight_Getlist_Input_1 = wdContext.nodeBapi_Flight_Getlist_Input_1().createAndAddBapi_Flight_Getlist_Input_1Element().modelObject();

//Creating the model node to add entries
Bapisfldst destination_From_1 = new Bapisfldst(flightModelModel);
Bapisfldst destination_To_1 = new Bapisfldst(flightModelModel);
    	
        if(wdContext.nodeDestination_Fr() != null)
        {
                     //setting the values of the input node
        	destination_From_1.setAirportid(wdContext.currentDestination_FrElement().getAirportid());
        	destination_From_1.setCity(wdContext.currentDestination_FrElement().getCity());
        	destination_From_1.setCountr(wdContext.currentDestination_FrElement().getCountr());
        	destination_From_1.setCountr_Iso("");
        }
        
        if(wdContext.nodeDestination_ToList() != null)
        {
                     //setting the values of the input node
        	destination_To_1.setAirportid(wdContext.currentDestination_ToListElement().getAirportid());
        	destination_To_1.setCity(wdContext.currentDestination_ToListElement().getCity());
        	destination_To_1.setCountr(wdContext.currentDestination_ToListElement().getCountr());
        	destination_To_1.setCountr_Iso("");
        }
        
bapi_Flight_Getlist_Input_1.setDestination_From(destination_From_1);
bapi_Flight_Getlist_Input_1.setDestination_To(destination_To_1);       
wdContext.currentBapi_Flight_Getlist_Input_1Element().setAirline(wdContext.currentContextElement().getAirline());
wdContext.currentBapi_Flight_Getlist_Input_1Element().setMax_Rows(wdContext.currentContextElement().getMax_Rows());
    	
wdContext.currentBapi_Flight_Getlist_Input_1Element().modelObject().execute();

Hope this helps you.

Regards,

Poojith MV

Former Member
0 Kudos

Hi Poojith M V

Your Code is correct.

ARFC2 is using Bapisfldst destination_From_1 = new Bapisfldst(flightModelModel);

thanks.

Answers (1)

Answers (1)

Former Member
0 Kudos
Former Member
0 Kudos

hi Himanshu K

Thanks your help. But I using ARF2....

Maybe have other better way? Thanks.