cancel
Showing results for 
Search instead for 
Did you mean: 

passing table parameter from dynpro for java to sap r/3

Former Member
0 Kudos

I am sending table parameter from WebDynpro to sap r/3,but the table is not populating.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

can you post the exact code?

kk

Former Member
0 Kudos

i am using functional module and i am passing one table parameter ,but it is not populated from dynpro to function module's table parameter.

public void executeZwsacs_Sod_Alert1_Input( ltti.mod.com.Zwsacs_Alert sod_alert )

{

//@@begin executeZwsacs_Sod_Alert1_Input()

//$$begin Service Controller(1932542337)

IWDMessageManager manager = wdComponentAPI.getMessageManager();

try{

wdContext.currentSod_Tab_Itab_1Element().modelObject().setId(sod_alert.getId());

wdContext.currentSod_Tab_Itab_1Element().modelObject().setSend_Mail(sod_alert.getSend_Mail());

wdContext.currentSod_Tab_Itab_1Element().modelObject().setInd(sod_alert.getInd());

wdContext.currentZwsacs_Sod_Alert1_InputElement().modelObject().execute();

wdContext.nodeOutput().invalidate();

} catch(WDDynamicRFCExecuteException ce) {

manager.reportException(ce.getMessage(), false);

}

//$$end

//@@end

}

former_member365727
Active Contributor
0 Kudos

Hi,

Write the below code:


Zwsacs_Sod_Alert1_Input input = new Zwsacs_Sod_Alert1_Input();
wdContext.nodeZwsacs_Sod_Alert1_Input.bind(input);

// passing params to the table, considering table name as ZTable.
ZTable tableInput;
//if there is only one record to be inserted in the table then no need of for loop.
for(int i=0; i<3; i++)
{
 tableInput = new ZTable();
 tableInput.setId(sod_alert.getId());
 tableInput.setSend_Mail(sod_alert.getSend_Mail());
 tableInput.setInd(sod_alert.getInd());

//add the table input to function module input
input.addZTable(tableInput);
}
wdContext.currentZwsacs_Sod_Alert1_InputElement().modelObject().execute();
wdContext.nodeOutput().invalidate();

Refer to this thread for passing parameters to R/3 function module from Webdynpro

Regards

Srikanth

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

In 7.3:

// models

            RFCModel1 modeloGral = new RFCModel1();

            Zfmfi_Certificado_Ret_Pdf_Input modeloRfc =                          wdContext.currentZfmfi_Certificado_Ret_Pdf_InputElement().modelObject();

           

            // clean

            if(modeloRfc.getIt_Tipo_Ret_Pobl()!=null && modeloRfc.getIt_Tipo_Ret_Pobl().size()>0){

                           modeloRfc.getIt_Tipo_Ret_Pobl().removeAll(modeloRfc.getIt_Tipo_Ret_Pobl());

            }

           

            //fill

            IEt_RetencionesElement retElem;

           

            int cant = wdContext.nodeEt_Retenciones().size();

            for(int i=0; i<cant; i++){

               retElem = wdContext.nodeEt_Retenciones().getEt_RetencionesElementAt(i);

               Zfie_Tipo_Retencion_Poblacion retencion = new                                                                            Zfie_Tipo_Retencion_Poblacion(modeloGral);

                                retencion.setTipo_Ret(retElem.getTipo_Ret());

                                modeloRfc.addIt_Tipo_Ret_Pobl(retencion);

            }

Former Member
0 Kudos

thanx,

it's working.