06-29-2007 4:40 PM
Hello to everybody,
Is my first post on this forum and i wish to apologize from the beginning if is not the right thread for my question but i didn't find a better place.
I try to write a function using RFC API function on C programming language and was working smoothly until when i found this data structure problem .Now , i am not very sure that my understanding about data structure have the same meaning like on the SAP RFC SDK documentation but i will try to explain better by example :
BAPI function = "BAPI_PLANNEDORDER_GET_DET_LIST"
export parameter="SELECTIONCRITERIA"
import paramater="RETURN"
Are some fields (in my understanding) which should be in relation with import and export parameter
export("PLANT")="RO1P"
export("MRP_CTRLER")="888"
export("MATERIAL") = "8517501100"
export("PROD_LINE") = "LINE1"
export("END_SEL_DATE") = "2007-06-30"
export("STR_SEL_DATE") = "2007-06-01"
And some data should be retrieve from import parameter fields
import(Type)
import(ID)
import(NUMBER)
import(MESSAGE)
I read on the RFC SDK documentation that to use this kind of data i should use RfcInstallStructure and for export parameter i do it like :
/-----C code--
RFC_PARAMETER EXPORT_PARAM[1];
RFC_TYPE_ELEMENT rte[4];
char mbuff[255];
RFC_TYPEHANDLE rtehnd=0;
rte[0].name="PLANT";
rte[0].length=8;
rte[0].type=TYPEC;
rte[1].name="MRP_CTRLER";
rte[1].length=8;
rte[1].type=TYPEC;
rte[2].name="MATERIAL";
rte[2].length=8;
rte[2].type=TYPEC;
rte[3].name=" PROD_LINE ";
rte[3].length=8;
rte[3].type=TYPEC;
rte[4].name=" END_SEL_DATE";
rte[4].length=8;
rte[4].type=TYPEC;
rte[4].name=" STR_SEL_DATE";
rte[4].length=8;
rte[4].type=TYPEC;
RfcInstallStructure(RTEEXP,rte,ENTRIES(rte),& rtehnd);
EXPORT_PARAM[0].name= SELECTIONCRITERIA; //the name of the export param
EXPORT_PARAM[0].nlen=strlen(EXPORT_PARAM[0].name);
EXPORT_PARAM[0].addr=(void*)mbuff; //pointer address for value set here is my confusion.I have 4 values but only one pointer.
EXPORT_PARAM[0].leng=sizeof(mbuff);
EXPORT_PARAM[0].type=rtehnd; //type handler returned from RfcInstallStructure
/--
For the moment I stop it here because is coming my first question :
How can I set the value for the fields which are already installed by RfcInstallStructure ?
Thank you,
07-04-2007 10:25 AM
Problem solved.
Finally,I understand how it's working RFC structure data.
Thank you for your support.
Best Regards.