Skip to main content

Posts

Showing posts from March, 2014

SAP GUI Text check (Error Handling)

SAP GUI Text check (Error Handling) sapgui_status_bar_get_text("paramStatusBarText",                    BEGIN_OPTIONAL,                              "Recorded status bar text: Material document 4900089763 posted",                              "AdditionalInfo=sapgui1067",                    END_OPTIONAL);           lr_end_transaction("S31_SAP_Fleet_MIGO_1090_ClkPost", LR_AUTO); i = sapgui_status_bar_get_param("1", "param1", LAST); lr_output_message("Material Document Number is: %s",lr_eval_string("{param1}")); if(i==1)            { lr_output_message("Material Document creation failed and input data used is : %s", lr_eval_string("{pUserName}"));       ...

Error handling using Text Check

Error handling using if else condition. web_reg_find("Search=All",                      "Text/IC=Home Page",                      "SaveCount=home_count",                       LAST); //then after login block paste this code: if (atoi(lr_eval_string("{home_count}")) > 0)                 {                       lr_output_message("Log on Successful");                 }     else               {                     lr_output_message("Log on failed for the Login ID: %s", lr_eval_string("{pUserName}"));                     lr_exit( LR_E...

Save a parameter in notepad file

This code will create a notepad file and save the parameter into it. long fd; web_reg_save_param("saveID","LB=---","RB=---","ORD=1",Last); //Capture the value in "saveID" fd=fopen( "C:\\NotepadName.txt","a" ); //Path of notepad fprintf( fd,"%s\n",lr_eval_string("{saveID"})); //It will print the data and go to next line fclose( fd ); // It will close notepad.